



/*!
 * ZUI - v1.3.0 - 2015-05-18
 * http://zui.sexy
 * GitHub: https://github.com/easysoft/zui.git 
 * Copyright (c) 2015 cnezsoft.com; Licensed MIT
 */
!
function(f, d) {
    if ("undefined" == typeof f) {
        throw new Error("ZUI requires jQuery")
    }
    f.zui || (f.zui = function(c) {
        f.isPlainObject(c) && f.extend(f.zui, c)
    });
    var g = 0;
    f.zui({
        uuid: function() {
            return 1000 * (new Date).getTime() + g++%1000
        },
        callEvent: function(h, l, k) {
            if (f.isFunction(h)) {
                "undefined" != typeof k && (h = f.proxy(h, k));
                var j = h(l);
                return l && (l.result = j),
                !(void 0 !== j && !j)
            }
            return 1
        },
        clientLang: function() {
            var j, h = d.config;
            if ("undefined" != typeof h && h.clientLang) {
                j = h.clientLang
            } else {
                var b = f("html").attr("lang");
                j = b ? b: navigator.userLanguage || navigator.userLanguage || "zh_cn"
            }
            return j.replace("-", "_").toLowerCase()
        }
    }),
    f.fn.callEvent = function(j, q, p) {
        var o = f(this),
        n = j.indexOf(".zui."),
        m = j;
        0 > n && p && p.name ? j += "." + p.name: m = j.substring(0, n);
        var l = f.Event(j, q);
        if ("undefined" == typeof p && n > 0 && (p = o.data(j.substring(n + 1))), p && p.options) {
            var k = p.options[m];
            f.isFunction(k) && f.zui.callEvent(p.options[m], l, p)
        }
        return l
    }
} (jQuery, window),
function() {
    String.prototype.format || (String.prototype.format = function(g) {
        var f = this;
        if (arguments.length > 0) {
            var k;
            if (1 == arguments.length && "object" == typeof g) {
                for (var j in g) {
                    void 0 !== g[j] && (k = new RegExp("({" + j + "})", "g"), f = f.replace(k, g[j]))
                }
            } else {
                for (var h = 0; h < arguments.length; h++) {
                    void 0 !== arguments[h] && (k = new RegExp("({[" + h + "]})", "g"), f = f.replace(k, arguments[h]))
                }
            }
        }
        return f
    }),
    String.prototype.isNum || (String.prototype.isNum = function(f) {
        if (null !== f) {
            var d, g;
            return g = /\d*/i,
            d = f.match(g),
            d == f ? !0 : !1
        }
        return ! 1
    })
} (),
function(x, w, v) {
    function u() {
        t = w[q](function() {
            s.each(function() {
                var f = x(this),
                j = f.width(),
                h = f.height(),
                g = x.data(this, o); (j !== g.w || h !== g.h) && f.trigger(p, [g.w = j, g.h = h])
            }),
            u()
        },
        r[n])
    }
    var t, s = x([]),
    r = x.resize = x.extend(x.resize, {}),
    q = "setTimeout",
    p = "resize",
    o = p + "-special-event",
    n = "delay",
    m = "throttleWindow";
    r[n] = 250,
    r[m] = !0,
    x.event.special[p] = {
        setup: function() {
            if (!r[m] && this[q]) {
                return ! 1
            }
            var c = x(this);
            s = s.add(c),
            x.data(this, o, {
                w: c.width(),
                h: c.height()
            }),
            1 === s.length && u()
        },
        teardown: function() {
            if (!r[m] && this[q]) {
                return ! 1
            }
            var c = x(this);
            s = s.not(c),
            c.removeData(o),
            s.length || clearTimeout(t)
        },
        add: function(c) {
            function g(j, z, y) {
                var l = x(this),
                k = x.data(this, o) || {};
                k.w = z !== v ? z: l.width(),
                k.h = y !== v ? y: l.height(),
                f.apply(this, arguments)
            }
            if (!r[m] && this[q]) {
                return ! 1
            }
            var f;
            return x.isFunction(c) ? (f = c, g) : (f = c.handler, void(c.handler = g))
        }
    }
} (jQuery, this),
function() {
    Date.ONEDAY_TICKS = 86400000,
    Date.prototype.format || (Date.prototype.format = function(f) {
        var d = {
            "M+": this.getMonth() + 1,
            "d+": this.getDate(),
            "h+": this.getHours(),
            "m+": this.getMinutes(),
            "s+": this.getSeconds(),
            "q+": Math.floor((this.getMonth() + 3) / 3),
            "S+": this.getMilliseconds()
        };
        /(y+)/i.test(f) && (f = f.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length)));
        for (var g in d) {
            new RegExp("(" + g + ")").test(f) && (f = f.replace(RegExp.$1, 1 == RegExp.$1.length ? d[g] : ("00" + d[g]).substr(("" + d[g]).length)))
        }
        return f
    }),
    Date.prototype.addMilliseconds || (Date.prototype.addMilliseconds = function(b) {
        return this.setTime(this.getTime() + b),
        this
    }),
    Date.prototype.addDays || (Date.prototype.addDays = function(b) {
        return this.addMilliseconds(b * Date.ONEDAY_TICKS),
        this
    }),
    Date.prototype.clone || (Date.prototype.clone = function() {
        var b = new Date;
        return b.setTime(this.getTime()),
        b
    }),
    Date.isLeapYear || (Date.isLeapYear = function(b) {
        return b % 4 === 0 && b % 100 !== 0 || b % 400 === 0
    }),
    Date.getDaysInMonth || (Date.getDaysInMonth = function(d, c) {
        return [31, Date.isLeapYear(d) ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][c]
    }),
    Date.prototype.isLeapYear || (Date.prototype.isLeapYear = function() {
        return Date.isLeapYear(this.getFullYear())
    }),
    Date.prototype.clearTime || (Date.prototype.clearTime = function() {
        return this.setHours(0),
        this.setMinutes(0),
        this.setSeconds(0),
        this.setMilliseconds(0),
        this
    }),
    Date.prototype.getDaysInMonth || (Date.prototype.getDaysInMonth = function() {
        return Date.getDaysInMonth(this.getFullYear(), this.getMonth())
    }),
    Date.prototype.addMonths || (Date.prototype.addMonths = function(d) {
        var c = this.getDate();
        return this.setDate(1),
        this.setMonth(this.getMonth() + d),
        this.setDate(Math.min(c, this.getDaysInMonth())),
        this
    }),
    Date.prototype.getLastWeekday || (Date.prototype.getLastWeekday = function(d) {
        d = d || 1;
        for (var c = this.clone(); c.getDay() != d;) {
            c.addDays( - 1)
        }
        return c.clearTime(),
        c
    }),
    Date.prototype.isSameDay || (Date.prototype.isSameDay = function(b) {
        return b.toDateString() === this.toDateString()
    }),
    Date.prototype.isSameWeek || (Date.prototype.isSameWeek = function(f) {
        var d = this.getLastWeekday(),
        g = d.clone().addDays(7);
        return f >= d && g > f
    }),
    Date.prototype.isSameYear || (Date.prototype.isSameYear = function(b) {
        return this.getFullYear() === b.getFullYear()
    })
} (),
function(h, g) {
    var m = "localStorage",
    l = h[m],
    k = (h.store, "page_" + h.location.pathname + h.location.search),
    j = function() {
        this.slience = !0,
        this.enable = m in h && h[m] && h[m].setItem,
        this.storage = l,
        this.page = this.get(k, {})
    };
    j.prototype.pageSave = function() {
        if (g.isEmptyObject(this.page)) {
            this.remove(k)
        } else {
            var b, n = [];
            for (b in this.page) {
                var f = this.page[b];
                null === f && n.push(b)
            }
            for (b = n.length - 1; b >= 0; b--) {
                delete this.page[n[b]]
            }
            this.set(k, this.page)
        }
    },
    j.prototype.pageRemove = function(b) {
        "undefined" != typeof this.page[b] && (this.page[b] = null, this.pageSave())
    },
    j.prototype.pageClear = function() {
        this.page = {},
        this.pageSave()
    },
    j.prototype.pageGet = function(f, d) {
        var n = this.page[f];
        return void 0 === d || null !== n && void 0 !== n ? n: d
    },
    j.prototype.pageSet = function(b, d) {
        g.isPlainObject(b) ? g.extend(!0, this.page, b) : this.page[this.serialize(b)] = d,
        this.pageSave()
    },
    j.prototype.check = function() {
        if (!this.enable && !this.slience) {
            throw new Error("Browser not support localStorage or enable status been set true.")
        }
        return this.enable
    },
    j.prototype.length = function() {
        return this.check() ? l.getLength ? l.getLength() : l.length: 0
    },
    j.prototype.removeItem = function(b) {
        return l.removeItem(b),
        this
    },
    j.prototype.remove = function(b) {
        return this.removeItem(b)
    },
    j.prototype.getItem = function(b) {
        return l.getItem(b)
    },
    j.prototype.get = function(f, d) {
        var n = this.deserialize(this.getItem(f));
        return "undefined" != typeof n && null !== n || "undefined" == typeof d ? n: d
    },
    j.prototype.key = function(b) {
        return l.key(b)
    },
    j.prototype.setItem = function(d, c) {
        return l.setItem(d, c),
        this
    },
    j.prototype.set = function(d, c) {
        return void 0 === c ? this.remove(d) : (this.setItem(d, this.serialize(c)), this)
    },
    j.prototype.clear = function() {
        return l.clear(),
        this
    },
    j.prototype.forEach = function(f) {
        for (var d = l.length - 1; d >= 0; d--) {
            var n = l.key(d);
            f(n, this.get(n))
        }
        return this
    },
    j.prototype.getAll = function() {
        var b = {};
        return this.forEach(function(d, f) {
            b[d] = f
        }),
        b
    },
    j.prototype.serialize = function(b) {
        return "string" == typeof b ? b: JSON.stringify(b)
    },
    j.prototype.deserialize = function(d) {
        if ("string" != typeof d) {
            return void 0
        }
        try {
            return JSON.parse(d)
        } catch(c) {
            return d || void 0
        }
    },
    g.zui({
        store: new j
    })
} (window, jQuery),
function(x, w, v) {
    function u(g) {
        if (g = g.toLowerCase(), g && o.test(g)) {
            var f;
            if (4 === g.length) {
                var j = "#";
                for (f = 1; 4 > f; f += 1) {
                    j += g.slice(f, f + 1).concat(g.slice(f, f + 1))
                }
                g = j
            }
            var h = [];
            for (f = 1; 7 > f; f += 2) {
                h.push(parseInt("0x" + g.slice(f, f + 2)))
            }
            return {
                r: h[0],
                g: h[1],
                b: h[2],
                a: 1
            }
        }
        throw new Error("function hexToRgb: Wrong hex string! (hex: " + g + ")")
    }
    function t(c) {
        return "string" == typeof c && ("transparent" === c.toLowerCase() || n[c.toLowerCase()] || o.test(x.trim(c.toLowerCase())))
    }
    function s(E) {
        function D(b) {
            return b = 0 > b ? b + 1 : b > 1 ? b - 1 : b,
            1 > 6 * b ? l + (y - l) * b * 6 : 1 > 2 * b ? y: 2 > 3 * b ? l + (y - l) * (2 / 3 - b) * 6 : l
        }
        var C = E.h,
        B = E.s,
        A = E.l,
        z = E.a;
        C = p(C) % 360 / 360,
        B = q(p(B)),
        A = q(p(A)),
        z = q(p(z));
        var y = 0.5 >= A ? A * (B + 1) : A + B - A * B,
        l = 2 * A - y,
        h = {
            r: 255 * D(C + 1 / 3),
            g: 255 * D(C),
            b: 255 * D(C - 1 / 3),
            a: z
        };
        return h
    }
    function r(b, g, f) {
        return void 0 === f && (f = 0),
        void 0 === g && (g = 255),
        w.min(w.max(b, f), g)
    }
    function q(d, c) {
        return r(d, c)
    }
    function p(b) {
        return "number" == typeof b ? b: parseFloat(b)
    }
    var o = /^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/,
    n = {
        aliceblue: "#f0f8ff",
        antiquewhite: "#faebd7",
        aqua: "#00ffff",
        aquamarine: "#7fffd4",
        azure: "#f0ffff",
        beige: "#f5f5dc",
        bisque: "#ffe4c4",
        black: "#000000",
        blanchedalmond: "#ffebcd",
        blue: "#0000ff",
        blueviolet: "#8a2be2",
        brown: "#a52a2a",
        burlywood: "#deb887",
        cadetblue: "#5f9ea0",
        chartreuse: "#7fff00",
        chocolate: "#d2691e",
        coral: "#ff7f50",
        cornflowerblue: "#6495ed",
        cornsilk: "#fff8dc",
        crimson: "#dc143c",
        cyan: "#00ffff",
        darkblue: "#00008b",
        darkcyan: "#008b8b",
        darkgoldenrod: "#b8860b",
        darkgray: "#a9a9a9",
        darkgreen: "#006400",
        darkkhaki: "#bdb76b",
        darkmagenta: "#8b008b",
        darkolivegreen: "#556b2f",
        darkorange: "#ff8c00",
        darkorchid: "#9932cc",
        darkred: "#8b0000",
        darksalmon: "#e9967a",
        darkseagreen: "#8fbc8f",
        darkslateblue: "#483d8b",
        darkslategray: "#2f4f4f",
        darkturquoise: "#00ced1",
        darkviolet: "#9400d3",
        deeppink: "#ff1493",
        deepskyblue: "#00bfff",
        dimgray: "#696969",
        dodgerblue: "#1e90ff",
        firebrick: "#b22222",
        floralwhite: "#fffaf0",
        forestgreen: "#228b22",
        fuchsia: "#ff00ff",
        gainsboro: "#dcdcdc",
        ghostwhite: "#f8f8ff",
        gold: "#ffd700",
        goldenrod: "#daa520",
        gray: "#808080",
        green: "#008000",
        greenyellow: "#adff2f",
        honeydew: "#f0fff0",
        hotpink: "#ff69b4",
        indianred: "#cd5c5c",
        indigo: "#4b0082",
        ivory: "#fffff0",
        khaki: "#f0e68c",
        lavender: "#e6e6fa",
        lavenderblush: "#fff0f5",
        lawngreen: "#7cfc00",
        lemonchiffon: "#fffacd",
        lightblue: "#add8e6",
        lightcoral: "#f08080",
        lightcyan: "#e0ffff",
        lightgoldenrodyellow: "#fafad2",
        lightgray: "#d3d3d3",
        lightgreen: "#90ee90",
        lightpink: "#ffb6c1",
        lightsalmon: "#ffa07a",
        lightseagreen: "#20b2aa",
        lightskyblue: "#87cefa",
        lightslategray: "#778899",
        lightsteelblue: "#b0c4de",
        lightyellow: "#ffffe0",
        lime: "#00ff00",
        limegreen: "#32cd32",
        linen: "#faf0e6",
        magenta: "#ff00ff",
        maroon: "#800000",
        mediumaquamarine: "#66cdaa",
        mediumblue: "#0000cd",
        mediumorchid: "#ba55d3",
        mediumpurple: "#9370db",
        mediumseagreen: "#3cb371",
        mediumslateblue: "#7b68ee",
        mediumspringgreen: "#00fa9a",
        mediumturquoise: "#48d1cc",
        mediumvioletred: "#c71585",
        midnightblue: "#191970",
        mintcream: "#f5fffa",
        mistyrose: "#ffe4e1",
        moccasin: "#ffe4b5",
        navajowhite: "#ffdead",
        navy: "#000080",
        oldlace: "#fdf5e6",
        olive: "#808000",
        olivedrab: "#6b8e23",
        orange: "#ffa500",
        orangered: "#ff4500",
        orchid: "#da70d6",
        palegoldenrod: "#eee8aa",
        palegreen: "#98fb98",
        paleturquoise: "#afeeee",
        palevioletred: "#db7093",
        papayawhip: "#ffefd5",
        peachpuff: "#ffdab9",
        peru: "#cd853f",
        pink: "#ffc0cb",
        plum: "#dda0dd",
        powderblue: "#b0e0e6",
        purple: "#800080",
        red: "#ff0000",
        rosybrown: "#bc8f8f",
        royalblue: "#4169e1",
        saddlebrown: "#8b4513",
        salmon: "#fa8072",
        sandybrown: "#f4a460",
        seagreen: "#2e8b57",
        seashell: "#fff5ee",
        sienna: "#a0522d",
        silver: "#c0c0c0",
        skyblue: "#87ceeb",
        slateblue: "#6a5acd",
        slategray: "#708090",
        snow: "#fffafa",
        springgreen: "#00ff7f",
        steelblue: "#4682b4",
        tan: "#d2b48c",
        teal: "#008080",
        thistle: "#d8bfd8",
        tomato: "#ff6347",
        turquoise: "#40e0d0",
        violet: "#ee82ee",
        wheat: "#f5deb3",
        white: "#ffffff",
        whitesmoke: "#f5f5f5",
        yellow: "#ffff00",
        yellowgreen: "#9acd32"
    },
    m = function(f, d, y, l) {
        if (this.r = 0, this.g = 0, this.b = 0, this.a = 1, void 0 !== l && (this.a = q(p(l), 1)), void 0 !== f && void 0 !== d && void 0 !== y) {
            this.r = parseInt(q(p(f), 255)),
            this.g = parseInt(q(p(d), 255)),
            this.b = parseInt(q(p(y), 255))
        } else {
            if (void 0 !== f) {
                var k = typeof f;
                if ("string" == k) {
                    f = f.toLowerCase(),
                    "transparent" === f ? this.a = 0 : this.rgb(n[f] ? u(n[f]) : u(f))
                } else {
                    if ("number" == k && void 0 === d) {
                        this.r = parseInt(q(f, 255)),
                        this.g = this.r,
                        this.b = this.r
                    } else {
                        if ("object" == k && f.hasOwnProperty("r")) {
                            this.r = parseInt(q(p(f.r), 255)),
                            f.hasOwnProperty("g") && (this.g = parseInt(q(p(f.g), 255))),
                            f.hasOwnProperty("b") && (this.b = parseInt(q(p(f.b), 255))),
                            f.hasOwnProperty("a") && (this.a = q(p(f.a), 1))
                        } else {
                            if ("object" == k && f.hasOwnProperty("h")) {
                                var h = {
                                    h: q(p(f.h), 360),
                                    s: 1,
                                    l: 1,
                                    a: 1
                                };
                                f.hasOwnProperty("s") && (h.s = q(p(f.s), 1)),
                                f.hasOwnProperty("l") && (h.l = q(p(f.l), 1)),
                                f.hasOwnProperty("a") && (h.a = q(p(f.a), 1)),
                                this.rgb(s(h))
                            }
                        }
                    }
                }
            }
        }
    };
    m.prototype.rgb = function(d) {
        if (void 0 !== d) {
            if ("object" == typeof d) {
                d.hasOwnProperty("r") && (this.r = parseInt(q(p(d.r), 255))),
                d.hasOwnProperty("g") && (this.g = parseInt(q(p(d.g), 255))),
                d.hasOwnProperty("b") && (this.b = parseInt(q(p(d.b), 255))),
                d.hasOwnProperty("a") && (this.a = q(p(d.a), 1))
            } else {
                var c = parseInt(p(d));
                this.r = c,
                this.g = c,
                this.b = c
            }
            return this
        }
        return {
            r: this.r,
            g: this.g,
            b: this.b,
            a: this.a
        }
    },
    m.prototype.hue = function(d) {
        var c = this.toHsl();
        return void 0 === d ? c.h: (c.h = q(p(d), 360), this.rgb(s(c)), this)
    },
    m.prototype.darken = function(d) {
        var c = this.toHsl();
        return c.l -= d / 100,
        c.l = q(c.l, 1),
        this.rgb(s(c)),
        this
    },
    m.prototype.clone = function() {
        return new m(this.r, this.g, this.b, this.a)
    },
    m.prototype.lighten = function(b) {
        return this.darken( - b)
    },
    m.prototype.fade = function(b) {
        return this.a = q(b / 100, 1),
        this
    },
    m.prototype.spin = function(f) {
        var d = this.toHsl(),
        g = (d.h + f) % 360;
        return d.h = 0 > g ? 360 + g: g,
        this.rgb(s(d)),
        this
    },
    m.prototype.toHsl = function() {
        var F, E, D = this.r / 255,
        C = this.g / 255,
        B = this.b / 255,
        A = this.a,
        z = w.max(D, C, B),
        y = w.min(D, C, B),
        l = (z + y) / 2,
        b = z - y;
        if (z === y) {
            F = E = 0
        } else {
            switch (E = l > 0.5 ? b / (2 - z - y) : b / (z + y), z) {
            case D:
                F = (C - B) / b + (B > C ? 6 : 0);
                break;
            case C:
                F = (B - D) / b + 2;
                break;
            case B:
                F = (D - C) / b + 4
            }
            F /= 6
        }
        return {
            h: 360 * F,
            s: E,
            l: l,
            a: A
        }
    },
    m.prototype.luma = function() {
        var b = this.r / 255,
        g = this.g / 255,
        f = this.b / 255;
        return b = 0.03928 >= b ? b / 12.92 : w.pow((b + 0.055) / 1.055, 2.4),
        g = 0.03928 >= g ? g / 12.92 : w.pow((g + 0.055) / 1.055, 2.4),
        f = 0.03928 >= f ? f / 12.92 : w.pow((f + 0.055) / 1.055, 2.4),
        0.2126 * b + 0.7152 * g + 0.0722 * f
    },
    m.prototype.saturate = function(d) {
        var c = this.toHsl();
        return c.s += d / 100,
        c.s = q(c.s),
        this.rgb(s(c)),
        this
    },
    m.prototype.desaturate = function(b) {
        return this.saturate( - b)
    },
    m.prototype.contrast = function(g, f, j) {
        if (f = "undefined" == typeof f ? new m(255, 255, 255, 1) : new m(f), g = "undefined" == typeof g ? new m(0, 0, 0, 1) : new m(g), this.a < 0.5) {
            return g
        }
        if (j = void 0 === j ? 0.43 : p(j), g.luma() > f.luma()) {
            var h = f;
            f = g,
            g = h
        }
        return this.luma() < j ? f: g
    },
    m.prototype.hexStr = function() {
        var f = this.r.toString(16),
        d = this.g.toString(16),
        g = this.b.toString(16);
        return 1 == f.length && (f = "0" + f),
        1 == d.length && (d = "0" + d),
        1 == g.length && (g = "0" + g),
        "#" + f + d + g
    },
    m.prototype.toCssStr = function() {
        return this.a > 0 ? this.a < 1 ? "rgba(" + this.r + "," + this.g + "," + this.b + "," + this.a + ")": this.hexStr() : "transparent"
    },
    m.prototype.isColor = t,
    x.zui({
        Color: m
    })
} (jQuery, Math, window),
function(g) {
    var f = 0,
    j = ["primary", "red", "yellow", "green", "blue", "purple", "brown", "dark"],
    h = {
        theme: "light",
        primary: "#3280fc",
        secondary: "#145ccd",
        pale: "#ebf2f9",
        fore: "#353535",
        back: "#ffffff",
        grayDarker: "#222222",
        grayDark: "#333333",
        gray: "#808080",
        grayLight: "#dddddd",
        grayLighter: "#e5e5e5",
        grayPale: "#f1f1f1",
        white: "#ffffff",
        black: "#000000",
        red: "#ea644a",
        yellow: "#f1a325",
        green: "#38b03f",
        blue: "#03b8cf",
        purple: "#8666b8",
        brown: "#bd7b46",
        greenPale: "#ddf4df",
        yellowPale: "#fff0d5",
        redPale: "#ffe5e0",
        bluePale: "#ddf3f5",
        brownPale: "#f7ebe1",
        purplePale: "#f5eeff",
        light: "#ffffff",
        dark: "#353535",
        success: "#38b03f",
        warning: "#f1a325",
        danger: "#ea644a",
        info: "#03b8cf",
        important: "#bd7b46",
        special: "#8666b8",
        successPale: "#ddf4df",
        warningPale: "#fff0d5",
        dangerPale: "#ffe5e0",
        infoPale: "#ddf3f5",
        importantPale: "#f7ebe1",
        specialPale: "#f5eeff"
    };
    h.get = function(b) {
        return ("undefined" == typeof b || "random" === b) && (b = j[f++%j.length]),
        new g.zui.Color(h[b] ? h[b] : b)
    },
    g.zui({
        colorset: h
    }),
    g.zui.Color && g.extend(g.zui.Color, h)
} (jQuery),
+
function(d) {
    function c() {
        var g = document.createElement("bootstrap"),
        f = {
            WebkitTransition: "webkitTransitionEnd",
            MozTransition: "transitionend",
            OTransition: "oTransitionEnd otransitionend",
            transition: "transitionend"
        };
        for (var h in f) {
            if (void 0 !== g.style[h]) {
                return {
                    end: f[h]
                }
            }
        }
        return ! 1
    }
    d.fn.emulateTransitionEnd = function(f) {
        var j = !1,
        h = this;
        d(this).one("bsTransitionEnd",
        function() {
            j = !0
        });
        var g = function() {
            j || d(h).trigger(d.support.transition.end)
        };
        return setTimeout(g, f),
        this
    },
    d(function() {
        d.support.transition = c(),
        d.support.transition && (d.event.special.bsTransitionEnd = {
            bindType: d.support.transition.end,
            delegateType: d.support.transition.end,
            handle: function(f) {
                return d(f.target).is(this) ? f.handleObj.handler.apply(this, arguments) : void 0
            }
        })
    })
} (jQuery),
function(f) {
    var d = {
        zh_cn: '鎮ㄧ殑娴忚鍣ㄧ増鏈繃浣庯紝鏃犳硶浣撻獙鎵€鏈夊姛鑳斤紝寤鸿鍗囩骇鎴栬€呮洿鎹㈡祻瑙堝櫒銆� <a href="http://browsehappy.com/" target="_blank" class="alert-link">浜嗚В鏇村...</a>',
        zh_tw: '鎮ㄧ殑鐎忚鍣ㄧ増鏈亷浣庯紝鐒℃硶楂旈鎵€鏈夊姛鑳斤紝寤鸿鍗囩礆鎴栬€呮洿鎹㈢€忚鍣ㄣ€�<a href="http://browsehappy.com/" target="_blank" class="alert-link">浜嗚В鏇村...</a>',
        en: 'Your browser is too old, it has been unable to experience the colorful internet. We strongly recommend that you upgrade a better one. <a href="http://browsehappy.com/" target="_blank" class="alert-link">Learn more...</a>'
    },
    g = function() {
        var j = this.isIE,
        h = j();
        if (h) {
            for (var k = 10; k > 5; k--) {
                if (j(k)) {
                    h = k;
                    break
                }
            }
        }
        this.ie = h,
        this.cssHelper()
    };
    g.prototype.cssHelper = function() {
        var h = this.ie,
        j = f("html");
        j.toggleClass("ie", h).removeClass("ie-6 ie-7 ie-8 ie-9 ie-10"),
        h && j.addClass("ie-" + h).toggleClass("gt-ie-7 gte-ie-8 support-ie", h >= 8).toggleClass("lte-ie-7 lt-ie-8 outdated-ie", 8 > h).toggleClass("gt-ie-8 gte-ie-9", h >= 9).toggleClass("lte-ie-8 lt-ie-9", 9 > h).toggleClass("gt-ie-9 gte-ie-10", h >= 10).toggleClass("lte-ie-9 lt-ie-10", 10 > h)
    },
    g.prototype.tip = function() {
        if (this.ie && this.ie < 8) {
            var b = f("#browseHappyTip");
            b.length || (b = f('<div id="browseHappyTip" class="alert alert-dismissable alert-danger alert-block" style="position: relative; z-index: 99999"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">脳</button><div class="container"><div class="content text-center"></div></div></div>'), b.prependTo("body")),
            b.find(".content").html(this.browseHappyTip || d[f.zui.clientLang() || "zh_cn"])
        }
    },
    g.prototype.isIE = function(h) {
        var c = document.createElement("b");
        return c.innerHTML = "<!--[if IE " + (h || "") + "]><i></i><![endif]-->",
        1 === c.getElementsByTagName("i").length
    },
    g.prototype.isIE10 = function() {
        return ! 1
    },
    f.zui({
        browser: new g
    }),
    f(function() {
        f("body").hasClass("disabled-browser-tip") || f.zui.browser.tip()
    })
} (jQuery),
+
function(g) {
    var f = "zui.collapse",
    j = function(c, k) {
        this.$element = g(c),
        this.options = g.extend({},
        j.DEFAULTS, k),
        this.transitioning = null,
        this.options.parent && (this.$parent = g(this.options.parent)),
        this.options.toggle && this.toggle()
    };
    j.DEFAULTS = {
        toggle: !0
    },
    j.prototype.dimension = function() {
        var b = this.$element.hasClass("width");
        return b ? "width": "height"
    },
    j.prototype.show = function() {
        if (!this.transitioning && !this.$element.hasClass("in")) {
            var o = g.Event("show." + f);
            if (this.$element.trigger(o), !o.isDefaultPrevented()) {
                var n = this.$parent && this.$parent.find("> .panel > .in");
                if (n && n.length) {
                    var m = n.data(f);
                    if (m && m.transitioning) {
                        return
                    }
                    n.collapse("hide"),
                    m || n.data(f, null)
                }
                var l = this.dimension();
                this.$element.removeClass("collapse").addClass("collapsing")[l](0),
                this.transitioning = 1;
                var k = function() {
                    this.$element.removeClass("collapsing").addClass("in")[l]("auto"),
                    this.transitioning = 0,
                    this.$element.trigger("shown." + f)
                };
                if (!g.support.transition) {
                    return k.call(this)
                }
                var b = g.camelCase(["scroll", l].join("-"));
                this.$element.one(g.support.transition.end, g.proxy(k, this)).emulateTransitionEnd(350)[l](this.$element[0][b])
            }
        }
    },
    j.prototype.hide = function() {
        if (!this.transitioning && this.$element.hasClass("in")) {
            var l = g.Event("hide." + f);
            if (this.$element.trigger(l), !l.isDefaultPrevented()) {
                var k = this.dimension();
                this.$element[k](this.$element[k]())[0].offsetHeight,
                this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),
                this.transitioning = 1;
                var b = function() {
                    this.transitioning = 0,
                    this.$element.trigger("hidden." + f).removeClass("collapsing").addClass("collapse")
                };
                return g.support.transition ? void this.$element[k](0).one(g.support.transition.end, g.proxy(b, this)).emulateTransitionEnd(350) : b.call(this)
            }
        }
    },
    j.prototype.toggle = function() {
        this[this.$element.hasClass("in") ? "hide": "show"]()
    };
    var h = g.fn.collapse;
    g.fn.collapse = function(b) {
        return this.each(function() {
            var k = g(this),
            d = k.data(f),
            c = g.extend({},
            j.DEFAULTS, k.data(), "object" == typeof b && b);
            d || k.data(f, d = new j(this, c)),
            "string" == typeof b && d[b]()
        })
    },
    g.fn.collapse.Constructor = j,
    g.fn.collapse.noConflict = function() {
        return g.fn.collapse = h,
        this
    },
    g(document).on("click." + f + ".data-api", "[data-toggle=collapse]",
    function(s) {
        var r, q = g(this),
        p = q.attr("data-target") || s.preventDefault() || (r = q.attr("href")) && r.replace(/.*(?=#[^\s]+$)/, ""),
        o = g(p),
        n = o.data(f),
        m = n ? "toggle": q.data(),
        l = q.attr("data-parent"),
        b = l && g(l);
        n && n.transitioning || (b && b.find('[data-toggle=collapse][data-parent="' + l + '"]').not(q).addClass("collapsed"), q[o.hasClass("in") ? "addClass": "removeClass"]("collapsed")),
        o.collapse(m)
    })
} (window.jQuery),
+
function(r) {
    function q() {
        r(n).remove(),
        r(m).each(function(c) {
            var d = p(r(this));
            d.hasClass("open") && (d.trigger(c = r.Event("hide." + o)), c.isDefaultPrevented() || d.removeClass("open").trigger("hidden." + o))
        })
    }
    function p(f) {
        var h = f.attr("data-target");
        h || (h = f.attr("href"), h = h && /#/.test(h) && h.replace(/.*(?=#[^\s]*$)/, ""));
        var g = h && r(h);
        return g && g.length ? g: f.parent()
    }
    var o = "zui.dropdown",
    n = ".dropdown-backdrop",
    m = "[data-toggle=dropdown]",
    l = function(c) {
        r(c).on("click." + o, this.toggle)
    };
    l.prototype.toggle = function(s) {
        var d = r(this);
        if (!d.is(".disabled, :disabled")) {
            var c = p(d),
            b = c.hasClass("open");
            if (q(), !b) {
                if ("ontouchstart" in document.documentElement && !c.closest(".navbar-nav").length && r('<div class="dropdown-backdrop"/>').insertAfter(r(this)).on("click", q), c.trigger(s = r.Event("show." + o)), s.isDefaultPrevented()) {
                    return
                }
                c.toggleClass("open").trigger("shown." + o),
                d.focus()
            }
            return ! 1
        }
    },
    l.prototype.keydown = function(c) {
        if (/(38|40|27)/.test(c.keyCode)) {
            var v = r(this);
            if (c.preventDefault(), c.stopPropagation(), !v.is(".disabled, :disabled")) {
                var u = p(v),
                t = u.hasClass("open");
                if (!t || t && 27 == c.keyCode) {
                    return 27 == c.which && u.find(m).focus(),
                    v.click()
                }
                var s = r("[role=menu] li:not(.divider):visible a", u);
                if (s.length) {
                    var f = s.index(s.filter(":focus"));
                    38 == c.keyCode && f > 0 && f--,
                    40 == c.keyCode && f < s.length - 1 && f++,
                    ~f || (f = 0),
                    s.eq(f).focus()
                }
            }
        }
    };
    var k = r.fn.dropdown;
    r.fn.dropdown = function(c) {
        return this.each(function() {
            var f = r(this),
            b = f.data("dropdown");
            b || f.data("dropdown", b = new l(this)),
            "string" == typeof c && b[c].call(f)
        })
    },
    r.fn.dropdown.Constructor = l,
    r.fn.dropdown.noConflict = function() {
        return r.fn.dropdown = k,
        this
    };
    var j = o + ".data-api";
    r(document).on("click." + j, q).on("click." + j, ".dropdown form",
    function(b) {
        b.stopPropagation()
    }).on("click." + j, m, l.prototype.toggle).on("keydown." + j, m + ", [role=menu]", l.prototype.keydown)
} (window.jQuery),
+
function(g) {
    var f = '[data-dismiss="alert"]',
    k = "zui.alert",
    j = function(b) {
        g(b).on("click", f, this.close)
    };
    j.prototype.close = function(c) {
        function o() {
            l.trigger("closed." + k).remove()
        }
        var n = g(this),
        m = n.attr("data-target");
        m || (m = n.attr("href"), m = m && m.replace(/.*(?=#[^\s]*$)/, ""));
        var l = g(m);
        c && c.preventDefault(),
        l.length || (l = n.hasClass("alert") ? n: n.parent()),
        l.trigger(c = g.Event("close." + k)),
        c.isDefaultPrevented() || (l.removeClass("in"), g.support.transition && l.hasClass("fade") ? l.one(g.support.transition.end, o).emulateTransitionEnd(150) : o())
    };
    var h = g.fn.alert;
    g.fn.alert = function(c) {
        return this.each(function() {
            var d = g(this),
            b = d.data(k);
            b || d.data(k, b = new j(this)),
            "string" == typeof c && b[c].call(d)
        })
    },
    g.fn.alert.Constructor = j,
    g.fn.alert.noConflict = function() {
        return g.fn.alert = h,
        this
    },
    g(document).on("click." + k + ".data-api", f, j.prototype.close)
} (window.jQuery),
+
function(g) {
    var f = "zui.tab",
    j = function(c) {
        this.element = g(c)
    };
    j.prototype.show = function() {
        var o = this.element,
        n = o.closest("ul:not(.dropdown-menu)"),
        m = o.attr("data-target");
        if (m || (m = o.attr("href"), m = m && m.replace(/.*(?=#[^\s]*$)/, "")), !o.parent("li").hasClass("active")) {
            var l = n.find(".active:last a")[0],
            k = g.Event("show." + f, {
                relatedTarget: l
            });
            if (o.trigger(k), !k.isDefaultPrevented()) {
                var b = g(m);
                this.activate(o.parent("li"), n),
                this.activate(b, b.parent(),
                function() {
                    o.trigger({
                        type: "shown." + f,
                        relatedTarget: l
                    })
                })
            }
        }
    },
    j.prototype.activate = function(k, p, o) {
        function n() {
            m.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),
            k.addClass("active"),
            l ? (k[0].offsetWidth, k.addClass("in")) : k.removeClass("fade"),
            k.parent(".dropdown-menu") && k.closest("li.dropdown").addClass("active"),
            o && o()
        }
        var m = p.find("> .active"),
        l = o && g.support.transition && m.hasClass("fade");
        l ? m.one(g.support.transition.end, n).emulateTransitionEnd(150) : n(),
        m.removeClass("in")
    };
    var h = g.fn.tab;
    g.fn.tab = function(b) {
        return this.each(function() {
            var d = g(this),
            c = d.data(f);
            c || d.data(f, c = new j(this)),
            "string" == typeof b && c[b]()
        })
    },
    g.fn.tab.Constructor = j,
    g.fn.tab.noConflict = function() {
        return g.fn.tab = h,
        this
    },
    g(document).on("click.zui.tab.data-api", '[data-toggle="tab"], [data-toggle="pill"]',
    function(c) {
        c.preventDefault(),
        g(this).tab("show")
    })
} (window.jQuery),
+
function(g) {
    function f(c, l, d) {
        return this.each(function() {
            var n = g(this),
            m = n.data(k),
            b = g.extend({},
            j.DEFAULTS, n.data(), "object" == typeof c && c);
            m || n.data(k, m = new j(this, b)),
            "string" == typeof c ? m[c](l, d) : b.show && m.show(l, d)
        })
    }
    var k = "zui.modal",
    j = function(c, l) {
        this.options = l,
        this.$body = g(document.body),
        this.$element = g(c),
        this.$backdrop = this.isShown = null,
        this.scrollbarWidth = 0,
        "undefined" == typeof this.options.moveable && (this.options.moveable = this.$element.hasClass("modal-moveable")),
        this.options.remote && this.$element.find(".modal-content").load(this.options.remote, g.proxy(function() {
            this.$element.trigger("loaded." + k)
        },
        this))
    };
    j.VERSION = "3.2.0",
    j.TRANSITION_DURATION = 300,
    j.BACKDROP_TRANSITION_DURATION = 150,
    j.DEFAULTS = {
        backdrop: !0,
        keyboard: !0,
        show: !0,
        rememberPos: !0,
        position: "fit"
    },
    j.prototype.toggle = function(d, c) {
        return this.isShown ? this.hide() : this.show(d, c)
    },
    j.prototype.ajustPosition = function(l) {
        if ("undefined" == typeof l && (l = this.options.position), "undefined" != typeof l) {
            var p = this.$element.find(".modal-dialog"),
            o = Math.max(0, (g(window).height() - p.outerHeight()) / 2),
            n = "fit" == l ? 2 * o / 3 : "center" == l ? o: l;
            if (p.hasClass("modal-moveable")) {
                var m = this.options.rememberPos ? this.$element.data("modal-pos") : null;
                m || (m = {
                    left: Math.max(0, (g(window).width() - p.outerWidth()) / 2),
                    top: n
                }),
                p.css(m)
            } else {
                p.css("margin-top", n)
            }
        }
    },
    j.prototype.setMoveale = function() {
        var l = this,
        d = l.options,
        m = l.$element.find(".modal-dialog").removeClass("modal-dragged");
        m.toggleClass("modal-moveable", d.moveable),
        l.$element.data("modal-moveable-setup") || m.draggable({
            container: l.$element,
            handle: ".modal-header",
            before: function() {
                m.css("margin-top", "").addClass("modal-dragged")
            },
            finish: function(c) {
                l.$element.data("modal-pos", c.pos)
            }
        })
    },
    j.prototype.show = function(c, m) {
        var l = this,
        d = g.Event("show." + k, {
            relatedTarget: c
        });
        l.$element.trigger(d),
        l.isShown || d.isDefaultPrevented() || (l.isShown = !0, l.options.draggable && l.setMoveale(), l.checkScrollbar(), l.$body.addClass("modal-open"), l.setScrollbar(), l.escape(), l.$element.on("click.dismiss." + k, '[data-dismiss="modal"]', g.proxy(l.hide, l)), l.backdrop(function() {
            var n = g.support.transition && l.$element.hasClass("fade");
            l.$element.parent().length || l.$element.appendTo(l.$body),
            l.$element.show().scrollTop(0),
            n && l.$element[0].offsetWidth,
            l.$element.addClass("in").attr("aria-hidden", !1),
            l.ajustPosition(m),
            l.enforceFocus();
            var b = g.Event("shown." + k, {
                relatedTarget: c
            });
            n ? l.$element.find(".modal-dialog").one("bsTransitionEnd",
            function() {
                l.$element.trigger("focus").trigger(b)
            }).emulateTransitionEnd(j.TRANSITION_DURATION) : l.$element.trigger("focus").trigger(b)
        }))
    },
    j.prototype.hide = function(c) {
        c && c.preventDefault(),
        c = g.Event("hide." + k),
        this.$element.trigger(c),
        this.isShown && !c.isDefaultPrevented() && (this.isShown = !1, this.$body.removeClass("modal-open"), this.resetScrollbar(), this.escape(), g(document).off("focusin." + k), this.$element.removeClass("in").attr("aria-hidden", !0).off("click.dismiss." + k), g.support.transition && this.$element.hasClass("fade") ? this.$element.one("bsTransitionEnd", g.proxy(this.hideModal, this)).emulateTransitionEnd(j.TRANSITION_DURATION) : this.hideModal())
    },
    j.prototype.enforceFocus = function() {
        g(document).off("focusin." + k).on("focusin." + k, g.proxy(function(b) {
            this.$element[0] === b.target || this.$element.has(b.target).length || this.$element.trigger("focus")
        },
        this))
    },
    j.prototype.escape = function() {
        this.isShown && this.options.keyboard ? g(document).on("keydown.dismiss." + k, g.proxy(function(c) {
            if (27 == c.which) {
                var m = g.Event("escaping." + k),
                l = this.$element.triggerHandler(m, "esc");
                if (void 0 != l && !l) {
                    return
                }
                this.hide()
            }
        },
        this)) : this.isShown || g(document).off("keydown.dismiss." + k)
    },
    j.prototype.hideModal = function() {
        var b = this;
        this.$element.hide(),
        this.backdrop(function() {
            b.$element.trigger("hidden." + k)
        })
    },
    j.prototype.removeBackdrop = function() {
        this.$backdrop && this.$backdrop.remove(),
        this.$backdrop = null
    },
    j.prototype.backdrop = function(c) {
        var n = this,
        m = this.$element.hasClass("fade") ? "fade": "";
        if (this.isShown && this.options.backdrop) {
            var l = g.support.transition && m;
            if (this.$backdrop = g('<div class="modal-backdrop ' + m + '" />').appendTo(this.$body), this.$element.on("mousedown.dismiss." + k, g.proxy(function(b) {
                b.target === b.currentTarget && ("static" == this.options.backdrop ? this.$element[0].focus.call(this.$element[0]) : this.hide.call(this))
            },
            this)), l && this.$backdrop[0].offsetWidth, this.$backdrop.addClass("in"), !c) {
                return
            }
            l ? this.$backdrop.one("bsTransitionEnd", c).emulateTransitionEnd(j.BACKDROP_TRANSITION_DURATION) : c()
        } else {
            if (!this.isShown && this.$backdrop) {
                this.$backdrop.removeClass("in");
                var d = function() {
                    n.removeBackdrop(),
                    c && c()
                };
                g.support.transition && this.$element.hasClass("fade") ? this.$backdrop.one("bsTransitionEnd", d).emulateTransitionEnd(j.BACKDROP_TRANSITION_DURATION) : d()
            } else {
                c && c()
            }
        }
    },
    j.prototype.checkScrollbar = function() {
        document.body.clientWidth >= window.innerWidth || (this.scrollbarWidth = this.scrollbarWidth || this.measureScrollbar())
    },
    j.prototype.setScrollbar = function() {
        var b = parseInt(this.$body.css("padding-right") || 0, 10);
        this.scrollbarWidth && this.$body.css("padding-right", b + this.scrollbarWidth)
    },
    j.prototype.resetScrollbar = function() {
        this.$body.css("padding-right", "")
    },
    j.prototype.measureScrollbar = function() {
        var d = document.createElement("div");
        d.className = "modal-scrollbar-measure",
        this.$body.append(d);
        var c = d.offsetWidth - d.clientWidth;
        return this.$body[0].removeChild(d),
        c
    };
    var h = g.fn.modal;
    g.fn.modal = f,
    g.fn.modal.Constructor = j,
    g.fn.modal.noConflict = function() {
        return g.fn.modal = h,
        this
    },
    g(document).on("click." + k + ".data-api", '[data-toggle="modal"]',
    function(o) {
        var n = g(this),
        m = n.attr("href"),
        l = null;
        try {
            l = g(n.attr("data-target") || m && m.replace(/.*(?=#[^\s]+$)/, ""))
        } catch(c) {
            return
        }
        if (l.length) {
            var b = l.data(k) ? "toggle": g.extend({
                remote: !/#/.test(m) && m
            },
            l.data(), n.data());
            n.is("a") && o.preventDefault(),
            l.one("show." + k,
            function(d) {
                d.isDefaultPrevented() || l.one("hidden." + k,
                function() {
                    n.is(":visible") && n.trigger("focus")
                })
            }),
            f.call(l, b, this, n.data("position"))
        }
    })
} (jQuery),
+
function(f) {
    var d = function(h, c) {
        this.type = this.options = this.enabled = this.timeout = this.hoverState = this.$element = null,
        this.init("tooltip", h, c)
    };
    d.DEFAULTS = {
        animation: !0,
        placement: "top",
        selector: !1,
        template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',
        trigger: "hover focus",
        title: "",
        delay: 0,
        html: !1,
        container: !1
    },
    d.prototype.init = function(j, q, p) {
        this.enabled = !0,
        this.type = j,
        this.$element = f(q),
        this.options = this.getOptions(p);
        for (var o = this.options.trigger.split(" "), n = o.length; n--;) {
            var m = o[n];
            if ("click" == m) {
                this.$element.on("click." + this.type, this.options.selector, f.proxy(this.toggle, this))
            } else {
                if ("manual" != m) {
                    var l = "hover" == m ? "mouseenter": "focus",
                    k = "hover" == m ? "mouseleave": "blur";
                    this.$element.on(l + "." + this.type, this.options.selector, f.proxy(this.enter, this)),
                    this.$element.on(k + "." + this.type, this.options.selector, f.proxy(this.leave, this))
                }
            }
        }
        this.options.selector ? this._options = f.extend({},
        this.options, {
            trigger: "manual",
            selector: ""
        }) : this.fixTitle()
    },
    d.prototype.getDefaults = function() {
        return d.DEFAULTS
    },
    d.prototype.getOptions = function(c) {
        return c = f.extend({},
        this.getDefaults(), this.$element.data(), c),
        c.delay && "number" == typeof c.delay && (c.delay = {
            show: c.delay,
            hide: c.delay
        }),
        c
    },
    d.prototype.getDelegateOptions = function() {
        var h = {},
        j = this.getDefaults();
        return this._options && f.each(this._options,
        function(b, c) {
            j[b] != c && (h[b] = c)
        }),
        h
    },
    d.prototype.enter = function(h) {
        var j = h instanceof this.constructor ? h: f(h.currentTarget)[this.type](this.getDelegateOptions()).data("zui." + this.type);
        return clearTimeout(j.timeout),
        j.hoverState = "in",
        j.options.delay && j.options.delay.show ? void(j.timeout = setTimeout(function() {
            "in" == j.hoverState && j.show()
        },
        j.options.delay.show)) : j.show()
    },
    d.prototype.leave = function(h) {
        var j = h instanceof this.constructor ? h: f(h.currentTarget)[this.type](this.getDelegateOptions()).data("zui." + this.type);
        return clearTimeout(j.timeout),
        j.hoverState = "out",
        j.options.delay && j.options.delay.hide ? void(j.timeout = setTimeout(function() {
            "out" == j.hoverState && j.hide()
        },
        j.options.delay.hide)) : j.hide()
    },
    d.prototype.show = function() {
        var E = f.Event("show.zui." + this.type);
        if (this.hasContent() && this.enabled) {
            if (this.$element.trigger(E), E.isDefaultPrevented()) {
                return
            }
            var D = this.tip();
            this.setContent(),
            this.options.animation && D.addClass("fade");
            var C = "function" == typeof this.options.placement ? this.options.placement.call(this, D[0], this.$element[0]) : this.options.placement,
            B = /\s?auto?\s?/i,
            A = B.test(C);
            A && (C = C.replace(B, "") || "top"),
            D.detach().css({
                top: 0,
                left: 0,
                display: "block"
            }).addClass(C),
            this.options.container ? D.appendTo(this.options.container) : D.insertAfter(this.$element);
            var z = this.getPosition(),
            y = D[0].offsetWidth,
            x = D[0].offsetHeight;
            if (A) {
                var w = this.$element.parent(),
                v = C,
                u = document.documentElement.scrollTop || document.body.scrollTop,
                t = "body" == this.options.container ? window.innerWidth: w.outerWidth(),
                s = "body" == this.options.container ? window.innerHeight: w.outerHeight(),
                r = "body" == this.options.container ? 0 : w.offset().left;
                C = "bottom" == C && z.top + z.height + x - u > s ? "top": "top" == C && z.top - u - x < 0 ? "bottom": "right" == C && z.right + y > t ? "left": "left" == C && z.left - y < r ? "right": C,
                D.removeClass(v).addClass(C)
            }
            var q = this.getCalculatedOffset(C, z, y, x);
            this.applyPlacement(q, C),
            this.$element.trigger("shown.zui." + this.type)
        }
    },
    d.prototype.applyPlacement = function(v, u) {
        var t, s = this.tip(),
        r = s[0].offsetWidth,
        q = s[0].offsetHeight,
        p = parseInt(s.css("margin-top"), 10),
        o = parseInt(s.css("margin-left"), 10);
        isNaN(p) && (p = 0),
        isNaN(o) && (o = 0),
        v.top = v.top + p,
        v.left = v.left + o,
        s.offset(v).addClass("in");
        var n = s[0].offsetWidth,
        m = s[0].offsetHeight;
        if ("top" == u && m != q && (t = !0, v.top = v.top + q - m), /bottom|top/.test(u)) {
            var l = 0;
            v.left < 0 && (l = -2 * v.left, v.left = 0, s.offset(v), n = s[0].offsetWidth, m = s[0].offsetHeight),
            this.replaceArrow(l - r + n, n, "left")
        } else {
            this.replaceArrow(m - q, m, "top")
        }
        t && s.offset(v)
    },
    d.prototype.replaceArrow = function(j, h, k) {
        this.arrow().css(k, j ? 50 * (1 - j / h) + "%": "")
    },
    d.prototype.setContent = function() {
        var h = this.tip(),
        c = this.getTitle();
        this.options.tipId && h.attr("id", this.options.tipId),
        this.options.tipClass && h.addClass(this.options.tipClass),
        h.find(".tooltip-inner")[this.options.html ? "html": "text"](c),
        h.removeClass("fade in top bottom left right")
    },
    d.prototype.hide = function() {
        function h() {
            "in" != l.hoverState && k.detach()
        }
        var l = this,
        k = this.tip(),
        j = f.Event("hide.zui." + this.type);
        return this.$element.trigger(j),
        j.isDefaultPrevented() ? void 0 : (k.removeClass("in"), f.support.transition && this.$tip.hasClass("fade") ? k.one(f.support.transition.end, h).emulateTransitionEnd(150) : h(), this.$element.trigger("hidden.zui." + this.type), this)
    },
    d.prototype.fixTitle = function() {
        var b = this.$element; (b.attr("title") || "string" != typeof b.attr("data-original-title")) && b.attr("data-original-title", b.attr("title") || "").attr("title", "")
    },
    d.prototype.hasContent = function() {
        return this.getTitle()
    },
    d.prototype.getPosition = function() {
        var c = this.$element[0];
        return f.extend({},
        "function" == typeof c.getBoundingClientRect ? c.getBoundingClientRect() : {
            width: c.offsetWidth,
            height: c.offsetHeight
        },
        this.$element.offset())
    },
    d.prototype.getCalculatedOffset = function(j, h, l, k) {
        return "bottom" == j ? {
            top: h.top + h.height,
            left: h.left + h.width / 2 - l / 2
        }: "top" == j ? {
            top: h.top - k,
            left: h.left + h.width / 2 - l / 2
        }: "left" == j ? {
            top: h.top + h.height / 2 - k / 2,
            left: h.left - l
        }: {
            top: h.top + h.height / 2 - k / 2,
            left: h.left + h.width
        }
    },
    d.prototype.getTitle = function() {
        var j, h = this.$element,
        k = this.options;
        return j = h.attr("data-original-title") || ("function" == typeof k.title ? k.title.call(h[0]) : k.title)
    },
    d.prototype.tip = function() {
        return this.$tip = this.$tip || f(this.options.template)
    },
    d.prototype.arrow = function() {
        return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")
    },
    d.prototype.validate = function() {
        this.$element[0].parentNode || (this.hide(), this.$element = null, this.options = null)
    },
    d.prototype.enable = function() {
        this.enabled = !0
    },
    d.prototype.disable = function() {
        this.enabled = !1
    },
    d.prototype.toggleEnabled = function() {
        this.enabled = !this.enabled
    },
    d.prototype.toggle = function(h) {
        var j = h ? f(h.currentTarget)[this.type](this.getDelegateOptions()).data("zui." + this.type) : this;
        j.tip().hasClass("in") ? j.leave(j) : j.enter(j)
    },
    d.prototype.destroy = function() {
        this.hide().$element.off("." + this.type).removeData("zui." + this.type)
    };
    var g = f.fn.tooltip;
    f.fn.tooltip = function(b) {
        return this.each(function() {
            var j = f(this),
            h = j.data("zui.tooltip"),
            c = "object" == typeof b && b;
            h || j.data("zui.tooltip", h = new d(this, c)),
            "string" == typeof b && h[b]()
        })
    },
    f.fn.tooltip.Constructor = d,
    f.fn.tooltip.noConflict = function() {
        return f.fn.tooltip = g,
        this
    }
} (window.jQuery),
+
function(f) {
    var d = function(h, c) {
        this.init("popover", h, c)
    };
    if (!f.fn.tooltip) {
        throw new Error("Popover requires tooltip.js")
    }
    d.DEFAULTS = f.extend({},
    f.fn.tooltip.Constructor.DEFAULTS, {
        placement: "right",
        trigger: "click",
        content: "",
        template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
    }),
    d.prototype = f.extend({},
    f.fn.tooltip.Constructor.prototype),
    d.prototype.constructor = d,
    d.prototype.getDefaults = function() {
        return d.DEFAULTS
    },
    d.prototype.setContent = function() {
        var j = this.tip(),
        h = this.getTarget();
        if (h) {
            return h.find(".arrow").length < 1 && j.addClass("no-arrow"),
            void j.html(h.html())
        }
        var l = this.getTitle(),
        k = this.getContent();
        j.find(".popover-title")[this.options.html ? "html": "text"](l),
        j.find(".popover-content")[this.options.html ? "html": "text"](k),
        j.removeClass("fade top bottom left right in"),
        j.find(".popover-title").html() || j.find(".popover-title").hide()
    },
    d.prototype.hasContent = function() {
        return this.getTarget() || this.getTitle() || this.getContent()
    },
    d.prototype.getContent = function() {
        var h = this.$element,
        c = this.options;
        return h.attr("data-content") || ("function" == typeof c.content ? c.content.call(h[0]) : c.content)
    },
    d.prototype.getTarget = function() {
        var h = this.$element,
        k = this.options,
        j = h.attr("data-target") || ("function" == typeof k.target ? k.target.call(h[0]) : k.target);
        return j ? "$next" == j ? h.next(".popover") : f(j) : !1
    },
    d.prototype.arrow = function() {
        return this.$arrow = this.$arrow || this.tip().find(".arrow")
    },
    d.prototype.tip = function() {
        return this.$tip || (this.$tip = f(this.options.template)),
        this.$tip
    };
    var g = f.fn.popover;
    f.fn.popover = function(b) {
        return this.each(function() {
            var j = f(this),
            h = j.data("zui.popover"),
            c = "object" == typeof b && b;
            h || j.data("zui.popover", h = new d(this, c)),
            "string" == typeof b && h[b]()
        })
    },
    f.fn.popover.Constructor = d,
    f.fn.popover.noConflict = function() {
        return f.fn.popover = g,
        this
    }
} (window.jQuery),
function(g, f, j) {
    var h = function(d, k) {
        this.$ = g(d),
        this.options = this.getOptions(k),
        this.init()
    };
    h.DEFAULTS = {
        container: "body",
        deviation: 5,
        sensorOffsetX: 0,
        sensorOffsetY: 0
    },
    h.prototype.getOptions = function(c) {
        return c = g.extend({},
        h.DEFAULTS, this.$.data(), c)
    },
    h.prototype.callEvent = function(d, k) {
        return g.zui.callEvent(this.options[d], k, this)
    },
    h.prototype.init = function() {
        this.handleMouseEvents()
    },
    h.prototype.handleMouseEvents = function() {
        var l = this.$,
        k = this,
        c = this.options,
        b = "before";
        this.$triggerTarget = c.trigger ? (g.isFunction(c.trigger) ? c.trigger(l) : l.find(c.trigger)).first() : l,
        this.$triggerTarget.on("mousedown",
        function(G) {
            function F(n) {
                var u = {
                    left: n.pageX,
                    top: n.pageY
                };
                if (! (j.abs(u.left - K.left) < c.deviation && j.abs(u.top - K.top) < c.deviation)) {
                    if (null === z) {
                        var t = y.css("position");
                        "absolute" != t && "relative" != t && "fixed" != t && (C = t, y.css("position", "relative")),
                        z = l.clone().removeClass("drag-from").addClass("drag-shadow").css({
                            position: "absolute",
                            width: l.outerWidth(),
                            transition: "none"
                        }).appendTo(y),
                        l.addClass("dragging"),
                        k.callEvent("start", {
                            event: n,
                            element: l
                        })
                    }
                    var q = {
                        left: u.left - I.left,
                        top: u.top - I.top
                    },
                    p = {
                        left: q.left - J.left,
                        top: q.top - J.top
                    };
                    z.css(p),
                    H.left = u.left,
                    H.top = u.top;
                    var o = !1;
                    x = !1,
                    c.flex || B.removeClass("drop-to");
                    var r = null;
                    if (B.each(function() {
                        var s = g(this),
                        O = s.offset(),
                        N = s.outerWidth(),
                        M = s.outerHeight(),
                        w = O.left + c.sensorOffsetX,
                        v = O.top + c.sensorOffsetY;
                        return u.left > w && u.top > v && u.left < w + N && u.top < v + M && (r && r.removeClass("drop-to"), r = s, !c.nested) ? !1 : void 0
                    }), r) {
                        x = !0;
                        var m = r.data("id");
                        l.data("id") != m && (d = !1),
                        (null === A || A.data("id") !== m && !d) && (o = !0),
                        A = r,
                        c.flex && B.removeClass("drop-to"),
                        A.addClass("drop-to")
                    }
                    c.flex ? null !== A && A.length && (x = !0) : (l.toggleClass("drop-in", x), z.toggleClass("drop-in", x)),
                    k.callEvent("drag", {
                        event: n,
                        isIn: x,
                        target: A,
                        element: l,
                        isNew: o,
                        selfTarget: d,
                        clickOffset: I,
                        offset: q,
                        position: {
                            left: q.left - J.left,
                            top: q.top - J.top
                        },
                        mouseOffset: u
                    }),
                    n.preventDefault()
                }
            }
            function E(r) {
                if (C && y.css("position", C), null === z) {
                    return l.removeClass("drag-from"),
                    g(f).unbind("mousemove", F).unbind("mouseup", E),
                    void k.callEvent("always", {
                        event: r,
                        cancel: !0
                    })
                }
                x || (A = null);
                var q = !0,
                p = {
                    left: r.pageX,
                    top: r.pageY
                },
                o = {
                    left: p.left - I.left,
                    top: p.top - I.top
                },
                m = {
                    left: p.left - H.left,
                    top: p.top - H.top
                };
                H.left = p.left,
                H.top = p.top;
                var n = {
                    event: r,
                    isIn: x,
                    target: A,
                    element: l,
                    isNew: !d && null !== A,
                    selfTarget: d,
                    offset: o,
                    mouseOffset: p,
                    position: {
                        left: o.left - J.left,
                        top: o.top - J.top
                    },
                    lastMouseOffset: H,
                    moveOffset: m
                };
                q = k.callEvent("beforeDrop", n),
                q && x && k.callEvent("drop", n),
                g(f).unbind("mousemove", F).unbind("mouseup", E),
                B.removeClass("drop-to"),
                l.removeClass("dragging").removeClass("drag-from"),
                z.remove(),
                k.callEvent("finish", n),
                k.callEvent("always", n),
                r.preventDefault()
            }
            if (c.hasOwnProperty(b) && g.isFunction(c[b])) {
                var D = c[b]({
                    event: G,
                    element: l
                });
                if (void 0 !== D && !D) {
                    return
                }
            }
            var C, B = g.isFunction(c.target) ? c.target(l) : g(c.target),
            A = null,
            z = null,
            y = g(c.container).first(),
            x = !1,
            d = !0,
            L = l.offset(),
            K = {
                left: G.pageX,
                top: G.pageY
            },
            J = y.offset(),
            I = {
                left: K.left - L.left,
                top: K.top - L.top
            },
            H = {
                left: K.left,
                top: K.top
            };
            l.addClass("drag-from"),
            g(f).bind("mousemove", F).bind("mouseup", E),
            G.preventDefault()
        })
    },
    h.prototype.reset = function() {
        this.$triggerTarget.off("mousedown"),
        this.handleMouseEvents()
    },
    g.fn.droppable = function(c) {
        return this.each(function() {
            var k = g(this),
            d = k.data("zui.droppable"),
            b = "object" == typeof c && c;
            d || k.data("zui.droppable", d = new h(this, b)),
            "string" == typeof c && d[c]()
        })
    },
    g.fn.droppable.Constructor = h
} (jQuery, document, Math),
+
function(g, f, k, j) {
    var h = function(d, l) {
        this.$ = g(d),
        this.options = this.getOptions(l),
        this.init()
    };
    h.DEFAULTS = {
        selector: "li, div",
        dragCssClass: "invisible"
    },
    h.prototype.getOptions = function(c) {
        return c = g.extend({},
        h.DEFAULTS, this.$.data(), c)
    },
    h.prototype.init = function() {
        this.bindEventToList(this.$.children(this.options.selector))
    },
    h.prototype.reset = function() {
        var d = this,
        l = this.$.children(this.options.selector).not(".drag-shadow");
        l.each(function() {
            var b = g(this);
            b.data("zui.droppable") ? (b.data("zui.droppable").options.target = l, b.droppable("reset")) : d.bindEventToList(b)
        })
    },
    h.prototype.bindEventToList = function(l) {
        function o(p) {
            var s = [];
            p.each(function() {
                var c = g(this).data("order");
                "number" == typeof c && s.push(c)
            }),
            s.sort(function(d, c) {
                return d - c
            });
            for (var r = p.length; s.length < r;) {
                s.push(s.length ? s[s.length - 1] + 1 : 0)
            }
            m.reverse && s.reverse();
            var q = 0;
            p.each(function() {
                g(this).attr("data-order", s[q++])
            })
        }
        var n = this.$,
        m = this.options;
        o(l),
        l.droppable({
            trigger: m.trigger,
            target: n.children(m.selector),
            container: n,
            always: m.always,
            flex: !0,
            start: function(c) {
                m.dragCssClass && c.element.addClass(m.dragCssClass),
                g.zui.callEvent(m.start)
            },
            drag: function(c) {
                if (n.addClass("sortable-sorting"), c.isIn) {
                    var s = c.element,
                    r = c.target,
                    q = s.attr("data-order"),
                    p = r.attr("data-order");
                    if (q == p) {
                        return
                    }
                    q > p ? r.before(s) : r.after(s);
                    var d = n.children(m.selector).not(".drag-shadow");
                    o(d),
                    g.zui.callEvent(m.order, {
                        list: d,
                        element: s
                    })
                }
            },
            finish: function(c) {
                m.dragCssClass && c.element && c.element.removeClass(m.dragCssClass),
                g.zui.callEvent(m.finish, {
                    list: n.children(m.selector),
                    element: c.element
                }),
                n.removeClass("sortable-sorting")
            }
        })
    },
    g.fn.sortable = function(c) {
        return this.each(function() {
            var m = g(this),
            l = m.data("zui.sortable"),
            b = "object" == typeof c && c;
            l ? "object" == typeof c && l.reset() : m.data("zui.sortable", l = new h(this, b)),
            "string" == typeof c && l[c]()
        })
    },
    g.fn.sortable.Constructor = h
} (jQuery, window, document, Math),
function(d, c) {
    "function" == typeof define && define.amd ? define(["jquery"], c) : "object" == typeof exports ? module.exports = c(require("jquery")) : d.bootbox = c(d.jQuery)
} (this,
function a(I, H) {
    function G() {
        var b;
        if ("undefined" != typeof config && config.clientLang) {
            b = config.clientLang
        } else {
            var d = I("html").attr("lang");
            b = d ? d: "en"
        }
        return b.replace("-", "_").toLowerCase()
    }
    function F(d) {
        var c = s[u.locale];
        return c ? c[d] : s.en[d]
    }
    function E(b, h, g) {
        b.stopPropagation(),
        b.preventDefault();
        var f = I.isFunction(g) && g(b) === !1;
        f || h.modal("hide")
    }
    function D(f) {
        var d, g = 0;
        for (d in f) {
            g++
        }
        return g
    }
    function C(b, g) {
        var f = 0;
        I.each(b,
        function(d, c) {
            g(d, c, f++)
        })
    }
    function B(b) {
        var g, f;
        if ("object" != typeof b) {
            throw new Error("Please supply an object of options")
        }
        if (!b.message) {
            throw new Error("Please specify a message")
        }
        return b = I.extend({},
        u, b),
        b.buttons || (b.buttons = {}),
        b.backdrop = b.backdrop ? "static": !1,
        g = b.buttons,
        f = D(g),
        C(g,
        function(c, h, d) {
            if (I.isFunction(h) && (h = g[c] = {
                callback: h
            }), "object" !== I.type(h)) {
                throw new Error("button with key " + c + " must be an object")
            }
            h.label || (h.label = c),
            h.className || (h.className = 1 == f || f >= 2 && "confirm" === c ? "btn-primary": "btn-default")
        }),
        b
    }
    function A(g, f) {
        var j = g.length,
        h = {};
        if (1 > j || j > 2) {
            throw new Error("Invalid argument length")
        }
        return 2 === j || "string" == typeof g[0] ? (h[f[0]] = g[0], h[f[1]] = g[1]) : h = g[0],
        h
    }
    function z(b, g, f) {
        return I.extend(!0, {},
        b, A(g, f))
    }
    function y(g, f, k, j) {
        var h = {
            className: "bootbox-" + g,
            buttons: x.apply(null, f)
        };
        return w(z(h, j, k), f)
    }
    function x() {
        for (var j = {},
        h = 0,
        n = arguments.length; n > h; h++) {
            var m = arguments[h],
            l = m.toLowerCase(),
            k = m.toUpperCase();
            j[l] = {
                label: F(k)
            }
        }
        return j
    }
    function w(f, c) {
        var g = {};
        return C(c,
        function(h, d) {
            g[d] = !0
        }),
        C(f.buttons,
        function(b) {
            if (g[b] === H) {
                throw new Error("button key " + b + " is not allowed (options are " + c.join("\n") + ")")
            }
        }),
        f
    }
    var v = {
        dialog: "<div class='bootbox modal' tabindex='-1' role='dialog'><div class='modal-dialog'><div class='modal-content'><div class='modal-body'><div class='bootbox-body'></div></div></div></div></div>",
        header: "<div class='modal-header'><h4 class='modal-title'></h4></div>",
        footer: "<div class='modal-footer'></div>",
        closeButton: "<button type='button' class='bootbox-close-button close' data-dismiss='modal' aria-hidden='true'>&times;</button>",
        form: "<form class='bootbox-form'></form>",
        inputs: {
            text: "<input class='bootbox-input bootbox-input-text form-control' autocomplete=off type=text />",
            textarea: "<textarea class='bootbox-input bootbox-input-textarea form-control'></textarea>",
            email: "<input class='bootbox-input bootbox-input-email form-control' autocomplete='off' type='email' />",
            select: "<select class='bootbox-input bootbox-input-select form-control'></select>",
            checkbox: "<div class='checkbox'><label><input class='bootbox-input bootbox-input-checkbox' type='checkbox' /></label></div>",
            date: "<input class='bootbox-input bootbox-input-date form-control' autocomplete=off type='date' />",
            time: "<input class='bootbox-input bootbox-input-time form-control' autocomplete=off type='time' />",
            number: "<input class='bootbox-input bootbox-input-number form-control' autocomplete=off type='number' />",
            password: "<input class='bootbox-input bootbox-input-password form-control' autocomplete='off' type='password' />"
        }
    },
    u = {
        locale: G(),
        backdrop: !0,
        animate: !0,
        className: null,
        closeButton: !0,
        show: !0,
        container: "body"
    },
    t = {};
    t.alert = function() {
        var b;
        if (b = y("alert", ["ok"], ["message", "callback"], arguments), b.callback && !I.isFunction(b.callback)) {
            throw new Error("alert requires callback property to be a function when provided")
        }
        return b.buttons.ok.callback = b.onEscape = function() {
            return I.isFunction(b.callback) ? b.callback() : !0
        },
        t.dialog(b)
    },
    t.confirm = function() {
        var b;
        if (b = y("confirm", ["confirm", "cancel"], ["message", "callback"], arguments), b.buttons.cancel.callback = b.onEscape = function() {
            return b.callback(!1)
        },
        b.buttons.confirm.callback = function() {
            return b.callback(!0)
        },
        !I.isFunction(b.callback)) {
            throw new Error("confirm requires a callback")
        }
        return t.dialog(b)
    },
    t.prompt = function() {
        var K, J, q, o, n, m, k;
        o = I(v.form),
        J = {
            className: "bootbox-prompt",
            buttons: x("confirm", "cancel"),
            value: "",
            inputType: "text"
        },
        K = w(z(J, arguments, ["title", "callback"]), ["cancel", "confirm"]),
        m = K.show === H ? !0 : K.show;
        var h = ["date", "time", "number"],
        c = document.createElement("input");
        if (c.setAttribute("type", K.inputType), h[K.inputType] && (K.inputType = c.type), K.message = o, K.buttons.cancel.callback = K.onEscape = function() {
            return K.callback(null)
        },
        K.buttons.confirm.callback = function() {
            var g;
            switch (K.inputType) {
            case "text":
            case "textarea":
            case "email":
            case "select":
            case "date":
            case "time":
            case "number":
            case "password":
                g = n.val();
                break;
            case "checkbox":
                var f = n.find("input:checked");
                g = [],
                C(f,
                function(j, l) {
                    g.push(I(l).val())
                })
            }
            return K.callback(g)
        },
        K.show = !1, !K.title) {
            throw new Error("prompt requires a title")
        }
        if (!I.isFunction(K.callback)) {
            throw new Error("prompt requires a callback")
        }
        if (!v.inputs[K.inputType]) {
            throw new Error("invalid prompt type")
        }
        switch (n = I(v.inputs[K.inputType]), K.inputType) {
        case "text":
        case "textarea":
        case "email":
        case "date":
        case "time":
        case "number":
        case "password":
            n.val(K.value);
            break;
        case "select":
            var b = {};
            if (k = K.inputOptions || [], !k.length) {
                throw new Error("prompt with select requires options")
            }
            C(k,
            function(f, j) {
                var g = n;
                if (j.value === H || j.text === H) {
                    throw new Error("given options in wrong format")
                }
                j.group && (b[j.group] || (b[j.group] = I("<optgroup/>").attr("label", j.group)), g = b[j.group]),
                g.append("<option value='" + j.value + "'>" + j.text + "</option>")
            }),
            C(b,
            function(f, d) {
                n.append(d)
            }),
            n.val(K.value);
            break;
        case "checkbox":
            var L = I.isArray(K.value) ? K.value: [K.value];
            if (k = K.inputOptions || [], !k.length) {
                throw new Error("prompt with checkbox requires options")
            }
            if (!k[0].value || !k[0].text) {
                throw new Error("given options in wrong format")
            }
            n = I("<div/>"),
            C(k,
            function(j, g) {
                var f = I(v.inputs[K.inputType]);
                f.find("input").attr("value", g.value),
                f.find("label").append(g.text),
                C(L,
                function(l, d) {
                    d === g.value && f.find("input").prop("checked", !0)
                }),
                n.append(f)
            })
        }
        return K.placeholder && n.attr("placeholder", K.placeholder),
        K.pattern && n.attr("pattern", K.pattern),
        o.append(n),
        o.on("submit",
        function(d) {
            d.preventDefault(),
            d.stopPropagation(),
            q.find(".btn-primary").click()
        }),
        q = t.dialog(K),
        q.off("shown.bs.modal"),
        q.on("shown.bs.modal",
        function() {
            n.focus()
        }),
        m === !0 && q.modal("show"),
        q
    },
    t.dialog = function(f) {
        f = B(f);
        var q = I(v.dialog),
        p = q.find(".modal-dialog"),
        o = q.find(".modal-body"),
        n = f.buttons,
        m = "",
        h = {
            onEscape: f.onEscape
        };
        if (C(n,
        function(d, c) {
            m += "<button data-bb-handler='" + d + "' type='button' class='btn " + c.className + "'>" + c.label + "</button>",
            h[d] = c.callback
        }), o.find(".bootbox-body").html(f.message), f.animate === !0 && q.addClass("fade"), f.className && q.addClass(f.className), "large" === f.size && p.addClass("modal-lg"), "small" === f.size && p.addClass("modal-sm"), f.title && o.before(v.header), f.closeButton) {
            var b = I(v.closeButton);
            f.title ? q.find(".modal-header").prepend(b) : b.css("margin-top", "-10px").prependTo(o)
        }
        return f.title && q.find(".modal-title").html(f.title),
        m.length && (o.after(v.footer), q.find(".modal-footer").html(m)),
        q.on("hidden.bs.modal",
        function(c) {
            c.target === this && q.remove()
        }),
        q.on("shown.bs.modal",
        function() {
            q.find(".btn-primary:first").focus()
        }),
        q.on("escape.close.bb",
        function(c) {
            h.onEscape && E(c, q, h.onEscape)
        }),
        q.on("click", ".modal-footer button",
        function(c) {
            var g = I(this).data("bb-handler");
            E(c, q, h[g])
        }),
        q.on("click", ".bootbox-close-button",
        function(c) {
            E(c, q, h.onEscape)
        }),
        q.on("keyup",
        function(c) {
            27 === c.which && q.trigger("escape.close.bb")
        }),
        I(f.container).append(q),
        q.modal({
            backdrop: f.backdrop,
            keyboard: !1,
            show: !1
        }),
        f.show && q.modal("show"),
        q
    },
    t.setDefaults = function() {
        var b = {};
        2 === arguments.length ? b[arguments[0]] = arguments[1] : b = arguments[0],
        I.extend(u, b)
    },
    t.hideAll = function() {
        I(".bootbox").modal("hide")
    };
    var s = {
        en: {
            OK: "OK",
            CANCEL: "Cancel",
            CONFIRM: "OK"
        },
        zh_cn: {
            OK: "纭",
            CANCEL: "鍙栨秷",
            CONFIRM: "纭"
        },
        zh_tw: {
            OK: "纰鸿獚",
            CANCEL: "鍙栨秷",
            CONFIRM: "纰鸿獚"
        }
    };
    return t.init = function(b) {
        return a(b || I)
    },
    t
}),
function(d) {
    var c = function(f, g) {
        this.$ = d(f),
        this.options = this.getOptions(g),
        this.init()
    };
    c.DEFAULTS = {
        container: "body",
        move: !0
    },
    c.prototype.getOptions = function(b) {
        return b = d.extend({},
        c.DEFAULTS, this.$.data(), b)
    },
    c.prototype.init = function() {
        this.handleMouseEvents()
    },
    c.prototype.handleMouseEvents = function() {
        var A, z, y, x, w, v = this.$,
        u = "before",
        t = "drag",
        s = "finish",
        r = this.options,
        q = function(g) {
            if (r.hasOwnProperty(u) && d.isFunction(r[u])) {
                var f = r[u]({
                    event: g,
                    element: v
                });
                if (void 0 !== f && !f) {
                    return
                }
            }
            var b = d(r.container),
            h = v.offset();
            z = b.offset(),
            A = {
                x: g.pageX,
                y: g.pageY
            },
            y = {
                x: g.pageX - h.left + z.left,
                y: g.pageY - h.top + z.top
            },
            x = d.extend({},
            A),
            w = !1,
            v.addClass("drag-ready"),
            d(document).bind("mousemove", p).bind("mouseup", o),
            g.preventDefault(),
            r.stopPropagation && g.stopPropagation()
        },
        p = function(k) {
            w = !0;
            var g = k.pageX,
            f = k.pageY,
            b = {
                left: g - y.x,
                top: f - y.y
            };
            v.removeClass("drag-ready").addClass("dragging"),
            r.move && v.css(b),
            r.hasOwnProperty(t) && d.isFunction(r[t]) && r[t]({
                event: k,
                element: v,
                startOffset: y,
                pos: b,
                offset: {
                    x: g - A.x,
                    y: f - A.y
                },
                smallOffset: {
                    x: g - x.x,
                    y: f - x.y
                }
            }),
            x.x = g,
            x.y = f,
            r.stopPropagation && k.stopPropagation()
        },
        o = function(f) {
            if (d(document).unbind("mousemove", p).unbind("mouseup", o), !w) {
                return void v.removeClass("drag-ready")
            }
            var b = {
                left: f.pageX - y.x,
                top: f.pageY - y.y
            };
            v.removeClass("drag-ready").removeClass("dragging"),
            r.move && v.css(b),
            r.hasOwnProperty(s) && d.isFunction(r[s]) && r[s]({
                event: f,
                element: v,
                pos: b,
                offset: {
                    x: f.pageX - A.x,
                    y: f.pageY - A.y
                },
                smallOffset: {
                    x: f.pageX - x.x,
                    y: f.pageY - x.y
                }
            }),
            f.preventDefault(),
            r.stopPropagation && f.stopPropagation()
        };
        r.handle ? v.on("mousedown", r.handle, q) : v.on("mousedown", q)
    },
    d.fn.draggable = function(b) {
        return this.each(function() {
            var j = d(this),
            h = j.data("zui.draggable"),
            g = "object" == typeof b && b;
            h || j.data("zui.draggable", h = new c(this, g)),
            "string" == typeof b && h[b]()
        })
    },
    d.fn.draggable.Constructor = c
} (jQuery);
function createLink(f, c, g, b, d) {
    if (!b) {
        b = config.defaultView
    }
    if (!d) {
        d = false
    }
    if (g) {
        g = g.split("&");
        for (i = 0; i < g.length; i++) {
            g[i] = g[i].split("=")
        }
    }
    if (config.requestType == "PATH_INFO") {
        link = config.webRoot + f + config.requestFix + c;
        if (g) {
            if (config.pathType == "full") {
                for (i = 0; i < g.length; i++) {
                    link += config.requestFix + g[i][0] + config.requestFix + g[i][1]
                }
            } else {
                for (i = 0; i < g.length; i++) {
                    link += config.requestFix + g[i][1]
                }
            }
        }
        link += "." + b
    } else {
        link = config.router + "?" + config.moduleVar + "=" + f + "&" + config.methodVar + "=" + c + "&" + config.viewVar + "=" + b;
        if (g) {
            for (i = 0; i < g.length; i++) {
                link += "&" + g[i][0] + "=" + g[i][1]
            }
        }
    }
    if (h == "yes" || d) {
        var h = config.requestType == "PATH_INFO" ? "?onlybody=yes": "&onlybody=yes";
        link = link + h
    }
    return link
}
function setSearchBox() {
    $("#typeSelector a").click(function() {
        $("#typeSelector li.active").removeClass("active");
        var b = $(this);
        b.closest("li").addClass("active");
        $("#searchType").val(b.data("value"));
        $("#searchTypeName").text(b.text())
    })
}
function shortcut() {
    objectType = $("#searchType").attr("value");
    objectValue = $("#searchQuery").attr("value");
    if (objectType && objectValue) {
        location.href = createLink(objectType, "view", "id=" + objectValue)
    }
}
function showDropMenu(d, j, g, h, c) {
    var b = $("#currentItem").closest("li");
    if (b.hasClass("show")) {
        b.removeClass("show");
        return
    }
    var f = $("#dropMenu");
    if (!b.data("showagain")) {
        b.data("showagain", true);
        $(document).click(function() {
            b.removeClass("show")
        });
        b.click(function(k) {
            k.stopPropagation()
        });
        f.on("keydown", "#search",
        function(o) {
            var m = o.which;
            var n = $("#searchResult > .search-list > ul > li.active");
            if (m === 38) {
                n.removeClass("active");
                if (n.length) {
                    var l = n.prev("li");
                    while (l.length && l.hasClass("heading")) {
                        l = l.prev("li")
                    }
                    if (l.length) {
                        l.addClass("active");
                        return
                    }
                }
                $("#searchResult > .search-list > ul > li:not(.heading):last").addClass("active")
            } else {
                if (m === 40) {
                    n.removeClass("active");
                    if (n.length) {
                        var k = n.next("li");
                        while (k.length && k.hasClass("heading")) {
                            k = k.next("li")
                        }
                        if (k.length) {
                            k.addClass("active");
                            return
                        }
                    }
                    $("#searchResult > .search-list > ul > li:not(.heading):first").addClass("active")
                } else {
                    if (m === 13) {
                        if (n.length) {
                            window.location.href = n.children("a").attr("href")
                        }
                    }
                }
            }
        }).on("change keyup paste input propertychange", "#search",
        function() {
            var k = $(this);
            var l = k.val();
            if (l === f.data("lastSearchKey")) {
                return
            }
            clearTimeout(f.data("lastSearch"));
            f.data("lastSearch", setTimeout(function() {
                f.data("lastSearchKey", l);
                searchItems(l, d, j, g, h, c)
            },
            200))
        }).on("mouseenter", "#searchResult .search-list > ul > li",
        function() {
            $("#searchResult > .search-list > ul > li.active").removeClass("active");
            $(this).addClass("active")
        })
    }
    $.get(createLink(d, "ajaxGetDropMenu", "objectID=" + j + "&module=" + g + "&method=" + h + "&extra=" + c),
    function(k) {
        f.html(k).find("#search").focus();
        $("#searchResult > .search-list > ul > li:not(.heading)").removeClass("active").first().addClass("active")
    });
    b.addClass("show")
}
function showDropResult(c, g, d, f, b) {
    $.get(createLink(c, "ajaxGetDropMenu", "objectID=" + g + "&module=" + d + "&method=" + f + "&extra=" + b),
    function(h) {
        $("#dropMenu").html(h);
        setTimeout(function() {
            $("#dropMenu #search").focus()
        },
        200);
        $("#searchResult > .search-list > ul > li:not(.heading)").removeClass("active").first().addClass("active")
    })
}
function searchItems(f, c, h, d, g, b) {
    if (f == "") {
        showMenu = 0;
        showDropResult(c, h, d, g, b)
    } else {
        f = encodeURI(f);
        if (f != "-") {
            $.get(createLink(c, "ajaxGetMatchedItems", "keywords=" + f + "&module=" + d + "&method=" + g + "&extra=" + b),
            function(j) {
                $("#searchResult").html(j).find(".search-list > ul > li:not(.heading)").removeClass("active").first().addClass("active")
            })
        }
    }
}
function switchMore() {
    $("#search").width($("#search").width()).focus();
    $("#moreMenu").width($("#defaultMenu").outerWidth());
    $("#searchResult").toggleClass("show-more")
}
function switchDocLib(d, c, f, b) {
    if (c == "doc") {
        if (f != "view" && f != "edit") {
            link = createLink(c, f, "rootID=" + d)
        } else {
            link = createLink("doc", "browse")
        }
    } else {
        if (c == "tree") {
            link = createLink(c, f, "rootID=" + d + "&type=" + b)
        }
    }
    location.href = link
}
function setPing() {
    $("#hiddenwin").attr("src", createLink("misc", "ping"))
}
function setRequiredFields() {
    if (!config.requiredFields) {
        return false
    }
    requiredFields = config.requiredFields.split(",");
    for (i = 0; i < requiredFields.length; i++) {
        $("#" + requiredFields[i]).closest("td,th").prepend("<div class='required required-wrapper'></div>");
        var b = $("#" + requiredFields[i]).closest('[class*="col-"]');
        if (b.parent().hasClass("form-group")) {
            b.addClass("required")
        }
    }
}
function setHelpLink() {
    if (!$.cookie("help")) {
        $.cookie("help", "off", {
            expires: config.cookieLife,
            path: config.webRoot
        })
    }
    className = $.cookie("help") == "off" ? "hidden": "";
    $("form input[id], form select[id], form textarea[id]").each(function() {
        if ($(this).attr("type") == "hidden" || $(this).attr("type") == "file") {
            return
        }
        currentFieldName = $(this).attr("name") ? $(this).attr("name") : $(this).attr("id");
        if (currentFieldName == "submit" || currentFieldName == "reset") {
            return
        }
        if (currentFieldName.indexOf("[") > 0) {
            currentFieldName = currentFieldName.substr(0, currentFieldName.indexOf("["))
        }
        currentFieldName = currentFieldName.toLowerCase();
        helpLink = createLink("help", "field", "module=" + config.currentModule + "&method=" + config.currentMethod + "&field=" + currentFieldName);
        $(this).after(' <a class="helplink ' + className + '" href=' + helpLink + ' target="_blank">?</a> ')
    });
    $("a.helplink").modalTrigger({
        width: 600,
        type: "iframe"
    })
}
function setPlaceholder() {
    if (typeof(holders) != "undefined") {
        for (var b in holders) {
            if ($("#" + b).prop("tagName") == "INPUT") {
                $("#" + b).attr("placeholder", holders[b])
            }
        }
    }
}
function toggleHelpLink() {
    $(".helplink").toggle();
    if ($.cookie("help") == "off") {
        return $.cookie("help", "on", {
            expires: config.cookieLife,
            path: config.webRoot
        })
    }
    if ($.cookie("help") == "on") {
        return $.cookie("help", "off", {
            expires: config.cookieLife,
            path: config.webRoot
        })
    }
}
function hideTreeBox(b) {
    $.cookie(b, "hide", {
        expires: config.cookieLife,
        path: config.webRoot
    });
    $(".outer").addClass("hide-side");
    $(".side-handle .icon-caret-left").removeClass("icon-caret-left").addClass("icon-caret-right")
    setTimeout(function() { Grid.refreshWidth();},500)
}
function showTreeBox(b) {
    $.cookie(b, "show", {
        expires: config.cookieLife,
        path: config.webRoot
    });
    $(".outer").removeClass("hide-side");
    $(".side-handle .icon-caret-right").removeClass("icon-caret-right").addClass("icon-caret-left")
    setTimeout(function() { Grid.refreshWidth();},500)
}
function toggleTreeBox() {
    var b = $(".side-handle").data("id");
    if (typeof b == "undefined" || b == null) {
        return
    }
    if ($.cookie(b) == "hide") {
        hideTreeBox(b)
    }
    $(".side-handle").toggle(function() {
        if ($.cookie(b) == "hide") {
            return showTreeBox(b)
        }
        hideTreeBox(b)
       
    },
    function() {
        if ($.cookie(b) == "show") {
            return hideTreeBox(b)
        }
        showTreeBox(b)
       
    });
    setTimeout(function() {
        $(".outer.with-side").addClass("with-transition");
    },1000)
}
function setTreeBox() {
    if ($(".outer > .side").length) {
        $(".outer").addClass("with-side")
    }
    toggleTreeBox()
}
function selectLang(b) {
    $.cookie("lang", b, {
        expires: config.cookieLife,
        path: config.webRoot
    });
    location.href = removeAnchor(location.href)
}
function selectTheme(b) {
    $.cookie("theme", b, {
        expires: config.cookieLife,
        path: config.webRoot
    });
    location.href = removeAnchor(location.href)
}
function removeAnchor(b) {
    pos = b.indexOf("#");
    if (pos > 0) {
        return b.substring(0, pos)
    }
    return b
}
function saveWindowSize() {
    width = $(window).width();
    height = $(window).height();
    $.cookie("windowWidth", width);
    $.cookie("windowHeight", height)
}
function setOuterBox() {
    if ($(".sub-featurebar").length) {
        $("#featurebar").addClass("with-sub")
    }
    var c = $("#wrap .outer > .side");
    var b = function() {
        var f = c.length ? (c.outerHeight() + $("#featurebar").outerHeight() + 20) : 0;
        var d = Math.max(f, $(window).height() - $("#header").height() - $("#footer").height() - 33);
        if (navigator.userAgent.indexOf("MSIE 8.0") >= 0) {
            d -= 40
        }
        $("#wrap .outer").css("min-height", d)
    };
    c.resize(b);
    $(window).resize(b);
    b()
}
function setForm() {
    var b = false;
    $("form").submit(function() {
        submitObj = $(this).find(":submit");
        if ($(submitObj).size() >= 1) {
            var d = submitObj.prop("tagName") == "BUTTON";
            submitLabel = d ? $(submitObj).html() : $(submitObj).attr("value");
            $(submitObj).attr("disabled", "disabled");
            var c = submitObj.attr("data-submitting") || lang.submitting;
            if (d) {
                submitObj.text(c)
            } else {
                $(submitObj).attr("value", c)
            }
            b = true
        }
    });
    $("body").click(function() {
        if (b) {
            $(submitObj).removeAttr("disabled");
            if (submitObj.prop("tagName") == "BUTTON") {
                submitObj.text(submitLabel)
            } else {
                $(submitObj).attr("value", submitLabel)
            }
            $(submitObj).removeClass("button-d")
        }
        b = false
    })
}
function setFormAction(b, c) {
    if (c) {
        $("form").attr("target", c)
    } else {
        $("form").removeAttr("target")
    }
    $("form").attr("action", b).submit()
}
function setImageSize(c, b) {
    if (!b) {
        bodyWidth = $("body").width();
        b = bodyWidth - 470
    }
    if ($(c).width() > b) {
        $(c).attr("width", b)
    }
    $(c).wrap('<a href="' + $(c).attr("src") + '" target="_blank"></a>')
}
function setModalTriggerLink() {
    $(".repolink").modalTrigger({
        width: 960,
        type: "iframe"
    });
    $(".export").modalTrigger({
        width: 650,
        type: "iframe"
    })
}
function setMailto(b, c) {
    link = createLink("user", "ajaxGetContactUsers", "listID=" + c);
    $.get(link,
    function(d) {
        $("#" + b).replaceWith(d);
        $("#" + b + "_chosen").remove();
        $("#" + b).chosen(defaultChosenOptions)
    })
}
function setComment() {
    $("#commentBox").toggle();
    $(".ke-container").css("width", "100%");
    setTimeout(function() {
        $("#commentBox textarea").focus()
    },
    50)
}
function autoCheck() {
    $(document).on("click", ".tablesorter tr :checkbox",
    function() {
        clickInCheckbox = 1
    });
    $(document).on("click", ".tablesorter:not(.table-datatable) tr",
    function() {
        if (document.activeElement.type != "select-one" && document.activeElement.type != "text") {
            if (typeof(clickInCheckbox) != "undefined" && clickInCheckbox == 1) {
                clickInCheckbox = 0
            } else {
                if ($(this).find(":checkbox").attr("checked")) {
                    $(this).find(":checkbox").attr("checked", false)
                } else {
                    $(this).find(":checkbox").attr("checked", true)
                }
            }
        }
    })
}
function toggleSearch() {
    $("#bysearchTab").toggle(function() {
        if (browseType == "bymodule") {
            $("#bymoduleTab").removeClass("active")
        } else {
            $("#" + browseType + "Tab").removeClass("active")
        }
        $("#bysearchTab").addClass("active");
        ajaxGetSearchForm();
        $("#querybox").addClass("show")
    },
    function() {
        if (browseType == "bymodule") {
            $("#bymoduleTab").addClass("active")
        } else {
            $("#" + browseType + "Tab").addClass("active")
        }
        $("#bysearchTab").removeClass("active");
        $("#querybox").removeClass("show")
    })
}
function ajaxGetSearchForm(b) {
    b = typeof(b) == "undefined" ? "#querybox": b;
    if ($(b).html() == "") {
        $.get(createLink("search", "buildForm"),
        function(c) {
            $(b).html(c)
        })
    }
}
function addItem(f, c) {
    ItemList = document.getElementById(f);
    Target = document.getElementById(c);
    for (var b = 0; b < ItemList.length; b++) {
        var d = ItemList.options[b];
        if (d.selected) {
            flag = true;
            for (var h = 0; h < Target.length; h++) {
                var g = Target.options[h];
                if (g.value == d.value) {
                    flag = false
                }
            }
            if (flag) {
                Target.options[Target.options.length] = new Option(d.text, d.value, 0, 0)
            }
        }
    }
}
function delItem(d) {
    ItemList = document.getElementById(d);
    for (var b = ItemList.length - 1; b >= 0; b--) {
        var c = ItemList.options[b];
        if (c.selected) {
            ItemList.options[b] = null
        }
    }
}
function upItem(d) {
    ItemList = document.getElementById(d);
    for (var b = 1; b < ItemList.length; b++) {
        var c = ItemList.options[b];
        if (c.selected) {
            tmpUpValue = ItemList.options[b - 1].value;
            tmpUpText = ItemList.options[b - 1].text;
            ItemList.options[b - 1].value = c.value;
            ItemList.options[b - 1].text = c.text;
            ItemList.options[b].value = tmpUpValue;
            ItemList.options[b].text = tmpUpText;
            ItemList.options[b - 1].selected = true;
            ItemList.options[b].selected = false;
            break
        }
    }
}
function downItem(d) {
    ItemList = document.getElementById(d);
    for (var b = 0; b < ItemList.length; b++) {
        var c = ItemList.options[b];
        if (c.selected) {
            tmpUpValue = ItemList.options[b + 1].value;
            tmpUpText = ItemList.options[b + 1].text;
            ItemList.options[b + 1].value = c.value;
            ItemList.options[b + 1].text = c.text;
            ItemList.options[b].value = tmpUpValue;
            ItemList.options[b].text = tmpUpText;
            ItemList.options[b + 1].selected = true;
            ItemList.options[b].selected = false;
            break
        }
    }
}
function selectItem(d) {
    ItemList = document.getElementById(d);
    for (var b = ItemList.length - 1; b >= 0; b--) {
        var c = ItemList.options[b];
        c.selected = true
    }
}
function ajaxDelete(b, d, c) {
    if (confirm(c)) {
        $.ajax({
            type: "GET",
            url: b,
            dataType: "json",
            success: function(f) {
                if (f.result == "success") {
                    $("#" + d).wrap("<div id='tmpDiv'></div>");
                    $("#tmpDiv").load(document.location.href + " #" + d,
                    function() {
                        $("#tmpDiv").replaceWith($("#tmpDiv").html());
                        if (typeof sortTable == "function") {
                            sortTable()
                        }
                        $("#" + d).find("[data-toggle=modal], a.iframe").modalTrigger()
                    })
                }
            }
        })
    }
}
function isNum(c) {
    if (c != null) {
        var d, b;
        b = /\d*/i;
        d = c.match(b);
        return (d == c) ? true: false
    }
    return false
}
function setModal() {
    jQuery.fn.modalTrigger = function(g) {
        return $(this).each(function() {
            var h = $(this);
            h.off("click.modalTrigger.zui");
            h.on("click.modalTrigger.zui",
            function(o) {
                var l = $(this);
                if (l.closest(".body-modal").length) {
                    return
                }
                if (l.hasClass("disabled")) {
                    return false
                }
                var k = (g ? g.url: false) || l.attr("href") || l.data("url");
                var n = (g ? g.type: false) || l.hasClass("iframe") ? "iframe": (l.data("type") || "ajax");
                if (n == "iframe") {
                    var j = {
                        url: k,
                        width: l.data("width") || 800,
                        height: l.data("height") || "auto",
                        icon: l.data("icon") || "?",
                        title: l.data("title") || l.attr("title") || l.text(),
                        name: l.data("name") || "modalIframe",
                        cssClass: l.data("class"),
                        headerless: l.data("headerless") || false,
                        center: l.data("center") || true
                    };
                    if (j.icon == "?") {
                        var m = l.find("[class^='icon-']");
                        j.icon = m.length ? m.attr("class").substring(5) : "file-text"
                    }
                    d($.extend(j, g))
                } else {
                    b();
                    $.get(k,
                    function(r) {
                        var q = {
                            width: l.data("width") || 800,
                            icon: l.data("icon") || "?",
                            title: l.data("title") || l.attr("title") || l.text(),
                        };
                        var s = $("#ajaxModal");
                        if (r.indexOf("modal-dialog") < 0) {
                            r = "<div class='modal-dialog modal-ajax' style='width: {width};'><div class='modal-content'><div class='modal-header'><button class='close' data-dismiss='modal'>脳</button><h4 class='modal-title'><i class='icon-{icon}'></i> {title}</h4></div><div class='modal-body' style='height:{height}'>{content}</div></div></div>".format($.extend({
                                content: r
                            },
                            q))
                        }
                        s.html(r);
                        if (l.data("width")) {
                            var p = parseInt(l.data("width"));
                            $(this).data("width", p).find(".modal-dialog").css("width", p);
                            f()
                        }
                        s.modal("show")
                    })
                }
                $("#ajaxModal").attr("rel", k);
                return false
            })
        })
    };
    function d(k) {
        var h = {
            width: 800,
            height: "auto",
            icon: "?",
            title: "",
            name: "modalIframe",
            cssClass: "",
            headerless: false,
            waittime: 0,
            center: true
        };
        if (typeof(k) == "string") {
            h.url = k
        } else {
            h = $.extend(h, k)
        }
        b(h);
        if (isNum(h.height.toString())) {
            h.height += "px"
        }
        if (isNum(h.width.toString())) {
            h.width += "px"
        }
        if (h.size == "fullscreen") {
            var m = $(window);
            h.width = m.width();
            h.height = m.height();
            h.cssClass += " fullscreen"
        }
        if (h.headerless) {
            h.cssClass += " hide-header"
        }
        if (typeof(h.url) == "undefined" || !h.url) {
            return false
        }
        var l = $("#ajaxModal").addClass("modal-loading").data("first", true);
        l.html("<div class='icon-spinner icon-spin loader'></div><div class='modal-dialog modal-iframe' style='width: {width};'><div class='modal-content'><div class='modal-header'><button class='close' data-dismiss='modal'>脳</button><h4 class='modal-title'><i class='icon-{icon}'></i> {title}</h4></div><div class='modal-body' style='height:{height}'><iframe id='{name}' name='{name}' src='{url}' frameborder='no' allowtransparency='true' scrolling='auto' hidefocus='' style='width: 100%; height: 100%; left: 0px;'></iframe></div></div></div>".format(h));
        var g = l.find(".modal-body"),
        j = l.find(".modal-dialog");
        if (h.cssClass) {
            j.addClass(h.cssClass)
        }
        if (h.waittime > 0) {
            h.waitingFuc = setTimeout(function() {
                c(h, l, g, j)
            },
            h.waittime)
        }
        var n = document.getElementById(h.name);
        n.onload = n.onreadystatechange = function() {
            if (this.readyState && this.readyState != "complete") {
                return
            }
            if (l.data("first") && (!l.hasClass("modal-loading"))) {
                return
            }
            if (!l.data("first")) {
                l.addClass("modal-loading")
            }
            if (h.waittime > 0) {
                clearTimeout(h.waitingFuc)
            }
            c(h, l, g, j)
        };
        l.modal("show")
    }
    function c(j, l, h, k) {
        h.css("height", j.height - l.find(".modal-header").outerHeight());
        try {
            var g = window.frames[j.name].$;
            if (g("#titlebar").length) {
                l.addClass("with-titlebar");
                if (j.size == "fullscreen") {
                    h.css("height", j.height)
                }
            }
            if (j.height == "auto") {
                var m = g("body");
                setTimeout(function() {
                    l.removeClass("fade");
                    var o = m.addClass("body-modal").outerHeight();
                    g("#titlebar > .heading a").each(function() {
                        var p = g(this);
                        p.replaceWith("<strong class='heading-title'>" + p.text() + "</strong>")
                    });
                    if (typeof o == "object") {
                        o = m.height()
                    }
                    h.css("height", o);
                    f();
                    if (l.data("first")) {
                        l.data("first", false)
                    }
                    l.removeClass("modal-loading").addClass("fade")
                },
                100);
                m.resize(function() {
                    var o = m.outerHeight();
                    if (typeof o == "object") {
                        o = m.height()
                    }
                    h.css("height", o);
                    f()
                })
            } else {
                l.removeClass("modal-loading")
            }
            if (g) {
                g.extend({
                    closeModal: $.closeModal
                })
            }
        } catch(n) {
            l.removeClass("modal-loading")
        }
    }
    function b(g) {
        if ($("#ajaxModal").length) {
            $("#ajaxModal").attr("class", "modal fade").off("show.zui.modal shown.zui.modal hide.zui.modal hidden.zui.modal")
        } else {
            $('<div id="ajaxModal" class="modal fade"></div>').appendTo("body")
        }
        $ajaxModal = $("#ajaxModal");
        $ajaxModal.data("cancel-reload", false);
        $.extend({
            closeModal: function(j, h) {
                $ajaxModal.on("hidden.zui.modal",
                function() {
                    if (h && (!$ajaxModal.data("cancel-reload"))) {
                        if (h == "this") {
                            window.location.reload()
                        } else {
                            window.location = h
                        }
                    }
                    if (j && $.isFunction(j)) {
                        j()
                    }
                });
                $ajaxModal.modal("hide")
            },
            cancelReloadCloseModal: function() {
                $ajaxModal.data("cancel-reload", true)
            }
        });
        if (!g) {
            return
        }
        if (g.afterShow && $.isFunction(g.afterShow)) {
            $ajaxModal.on("show.zui.modal", g.afterShow)
        }
        if (g.afterShown && $.isFunction(g.afterShown)) {
            $ajaxModal.on("shown.zui.modal", g.afterShown)
        }
        if (g.afterHide && $.isFunction(g.afterHide)) {
            $ajaxModal.on("hide.zui.modal", g.afterHide)
        }
        if (g.afterHidden && $.isFunction(g.afterHidden)) {
            $ajaxModal.on("hidden.zui.modal", g.afterHidden)
        }
    }
    function f(g, h) {
        g = g || "fit";
        if (!h) {
            h = $("#ajaxModal .modal-dialog")
        }
        if (g) {
            var j = Math.max(0, ($(window).height() - h.outerHeight()) / 2);
            var k = g == "fit" ? (j * 2 / 3) : (g == "center" ? j: g);
            h.css("margin-top", k)
        }
    }
    $.extend({
        ajustModalPosition: f,
        modalTrigger: d,
        colorbox: function(g) {
            if ((typeof g == "object") && g.iframe) {
                $.modalTrigger({
                    type: "iframe",
                    width: g.width,
                    afterHide: g.onCleanup,
                    url: g.href
                })
            }
        }
    });
    $("[data-toggle=modal], a.iframe").modalTrigger();
    jQuery.fn.colorbox = function(g) {
        if ((typeof g == "object") && g.iframe) {
            $(this).modalTrigger({
                type: "iframe",
                width: g.width,
                afterHide: g.onCleanup,
                url: g.href
            })
        }
    }
}
function setModal4List(d, c, f, b) {
    if (typeof(b) == "undefined") {
        b = 900
    }
    $("." + d).modalTrigger({
        width: b,
        type: "iframe",
        afterHide: function() {
            var h = $.cookie("selfClose");
            if (h != 1) {
                return
            }
            saveWindowSize();
            if (typeof(c) == "string" && c.length > 0) {
                $.cancelReloadCloseModal();
                var j = self.location.href;
                var g = "#" + c;
                $(g).wrap("<div id='tmpDiv'></div>");
                $("#tmpDiv").load(j + " " + g,
                function() {
                    $("#tmpDiv").replaceWith($("#tmpDiv").html());
                    setTimeout(function() {
                        setModal4List(d, c, f, b)
                    },
                    150);
                    var k = $(g),
                    m = $("#datatable-" + k.attr("id"));
                    if (k.hasClass("datatable") && m.length && $.fn.datatable) {
                        k.hide();
                        m.data("zui.datatable").load(g)
                    }
                    k.find("tbody tr:not(.active-disabled) td").click(function() {
                        $(this).closest("tr").toggleClass("active")
                    });
                    k.find("[data-toggle=modal], a.iframe").modalTrigger();
                    try {
                        $(".date").datetimepicker(datepickerOptions)
                    } catch(l) {}
                    if (typeof(e) == "function") {
                        f()
                    }
                    $.cookie("selfClose", 0)
                })
            }
        }
    })
}
function setTableBehavior() {
    $("#wrap .table:not(.table-data, .table-form, .active-disabled)").on("click", "tbody tr:not(.active-disabled) td",
    function() {
        $(this).closest("tr").toggleClass("active")
    });
    $("#wrap .outer > .table, #wrap .outer > form > .table, #wrap .outer > .mian > .table, #wrap .outer > .mian > form > .table, #wrap .outer > .container > .table").not(".table-data, .table-form, .table-custom").addClass("table table-condensed table-hover table-striped tablesorter")
}
function fixStyle() {
    var b = $("#titlebar > .actions");
    if (b.length) {
        $("#titlebar > .heading").css("padding-right", b.width())
    }
}
function startCron() {
    $.ajax({
        type: "GET",
        timeout: 100,
        url: createLink("cron", "ajaxExec")
    })
}
function computePasswordStrength(b) {
    if (b.length == 0) {
        return 0
    }
    var f = 0;
    var d = b.length;
    if (b.toLowerCase() != b) {
        f += 1
    }
    if (b.toUpperCase() == b) {
        f += 1
    }
    if (d >= 4 && d <= 7) {
        f += 1
    } else {
        if (d >= 8 && d <= 15) {
            f += 2
        } else {
            if (d >= 16 && d <= 35) {
                f += 3
            } else {
                if (d > 35) {
                    f += 4
                }
            }
        }
    }
    var c = "";
    for (i = 0; i < d; i++) {
        letter = b.charAt(i);
        if (letter >= 48 && letter <= 57) {
            f += 1
        } else {
            if ((letter >= 65 && letter <= 90)) {
                f += 1
            } else { (!(letter >= 97 && letter <= 122))
            }
        }
        f += 2;
        if (c.indexOf(letter) == -1) {
            c += letter
        }
    }
    f += c.length * 2;
    f = f > 89 ? 89 : f;
    f = Math.floor(f / 10);
    f = Math.floor(f / 3);
    return f
}
needPing = true;
$(document).ready(function() {
    $("body").addClass("m-{currentModule}-{currentMethod}".format(config));
    setModal();
    setTableBehavior();
    setForm();
    saveWindowSize();
    setSearchBox();
    setOuterBox();
    setRequiredFields();
    setPlaceholder();
    setModalTriggerLink();
    autoCheck();
    toggleSearch();
    fixStyle();
    $(window).resize(saveWindowSize);
    if (needPing) {
        setTimeout("setPing()", 1000 * 60 * 10)
    }
    $(".export").bind("click",
    function() {
        var b = "";
        $(":checkbox").each(function() {
            if ($(this).attr("checked")) {
                var c = parseInt($(this).val());
                if (c != 0) {
                    b = b + c + ","
                }
            }
        });
        if (b != "") {
            b = b.substring(0, b.length - 1)
        }
        $.cookie("checkedItem", b, {
            expires: config.cookieLife,
            path: config.webRoot
        })
    })
});
$(document).bind("keydown", "Ctrl+g",
function(b) {
    $("#searchQuery").attr("value", "");
    $("#searchQuery").focus();
    b.stopPropagation();
    b.preventDefault();
    return false
});
$(document).bind("keydown", "left",
function(b) {
    preLink = ($("#pre").attr("href"));
    if (typeof(preLink) != "undefined") {
        location.href = preLink
    }
});
$(document).bind("keydown", "right",
function(b) {
    nextLink = ($("#next").attr("href"));
    if (typeof(nextLink) != "undefined") {
        location.href = nextLink
    }
});
